Geant4 Cross Reference |
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 ##--------------------------------------------------------------------------------------------------------------------------##