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 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  1 #!/usr/bin/env bash
  2 #
  3 #############################################################################################################################
  4 #####               This is an example of slurm file to  submit a job to execute dsbandrepair on cluster                #####
  5 ##### In this example, each node on cluster has memory of 31 Gb. And there are 16 cpus per node. In phycal stage, the   #####
  6 ##### parallel proceeses running on each node (buy setting num_ranks_pernode) is sett based the memory required to hold #####
  7 ##### geometry. For instance, with geometry set provided along this dsbandrepair, fbroblast and endothelium needs~4.5Gb,#####
  8 #####  while yeast need ~4.5Gb and ~1.2GB respectively. Therefore, with a node of 31Gb memory, num_ranks_pernodeP       #####
  9 ##### can be set to 6 for fiborblast and endothelium, and 16 for yeast. For chemical stage, it is better to set the     #####    
 10 ##### number of chemical proceses on each node equal to the number of cpus. User should edit this file according to     #####
 11 ##### their need.                                                                                                       #####
 12 #############################################################################################################################
 13 ##--------------------------------------------------------------------------------------------------------------------------##
 14 #SBATCH --job-name="dsbandrepair"
 15 #SBATCH --partition=std
 16 #SBATCH --exclusive
 17 #SBATCH --nodes=5  
 18 ##SBATCH --mem=190Gb 
 19 ##SBATCH --nodelist=node118
 20 num_ranks_pernodeP=6 ## Number of Physical processes on each node. 
 21 num_ranks_pernodeC=16  ## Number of chemical processes on all nodes. should be 1 cpu for 1 process
 22 ## You can change above setting for your need.
 23 ##--------------------------------------------------------------------------------------------------------------------------##
 24 ## for physical stage:
 25 totalnumRankP=$(( $num_ranks_pernodeP*$SLURM_NNODES ))
 26 ## for chemicall stage:
 27 totalnumRankC=$(( $num_ranks_pernodeC*$SLURM_NNODES ))
 28 ##--------------------------------------------------------------------------------------------------------------------------##
 29 #" Check some requried files && folders
 30 physmacfile="dsbandrepair.in"  #change it if you use other files for default
 31 chemmacfile="chem.in" #change it if you use other files for default
 32 flag="all"
 33 ##Read input arguments
 34 for i in "$@"
 35 do
 36     if [ $i = "-f" ] ;then shift;unset flag;flag=$1;shift;fi
 37     if [ $i = "-mP" ] ; then shift;unset physmacfile; physmacfile=$1;shift;fi
 38     if [ $i = "-mC" ] ; then shift;unset chemmacfile; chemmacfile=$1;shift;fi
 39 done
 40 ##--------------------------------------------------------------------------------------------------------------------------##
 41 
 42 
 43 logfolder="logs"
 44 inputfolder="chem_input"
 45 if [ ! -d $logfolder ]; then 
 46 # folder to contain logfiles
 47     mkdir "$logfolder"
 48     mkdir "$logfolder/phys"
 49     mkdir "$logfolder/chem"
 50 fi  
 51 ##--------------------------------------------------------------------------------------------------------------------------##
 52 #START_TIME=$SECONDS
 53 ##--------------------------------------------------------------------------------------------------------------------------##
 54 ##If $flag = "phys", then run the physStage part
 55 if [ $flag = "phys" ] || [ $flag = "all" ]; then          
 56     echo "Start running physical stage................."
 57     echo "This job will run with: "
 58     echo "=====> Number of nodes: $SLURM_NNODES"
 59     echo "=====> Number of Ranks: $numRanks"   
 60     mpiexec -np $totalnumRankP -npernode $num_ranks_pernodeP ./dsbandrepair $physmacfile 
 61     wait
 62     echo "End running physical stage................."
 63 fi
 64 ##--------------------------------------------------------------------------------------------------------------------------##
 65 ##If $flag = "chem", then run the chemStage part
 66 wait # make sure all above processes finish before chemStage starts
 67 #sleep 1s
 68 if [ $flag = "chem" ] || [ $flag = "all" ]; then
 69     if [ -d $logfolder/chem ]; then find $logfolder/chem/ -type f -delete;fi
 70     echo "Start running chemical stage................."
 71     echo "with number of $totalnumRankC tasks.!!"
 72     echo "See $logfolder/* for running details"
 73     mpiexec -np $totalnumRankC ./dsbandrepair $chemmacfile chem $inputFolder > $logfolder/chem/log.dat
 74     wait
 75     echo "End running chemical stage on all tasks  ................."
 76 fi
 77 ##--------------------------------------------------------------------------------------------------------------------------##
 78 #echo "Elasped timed for $flag stage: $(($SECONDS - $START_TIME)) sec!!!"
 79 ##--------------------------------------------------------------------------------------------------------------------------##