setup.sh 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. #!/bin/bash
  2. ### Options for SimData configuration
  3. if [ -d /scratch1 ] || [ -d /scratch2 ] || [ -d /nica ]
  4. then
  5. export JOB_MANAGER=SGE
  6. fi
  7. if [ -d /lustre ]
  8. then
  9. export JOB_MANAGER=SLURM
  10. fi
  11. if [ -d /mnt/pool/nica/5 ]
  12. then
  13. export JOB_MANAGER=SLURM_MEPHI
  14. fi
  15. if [ -d /zfs/hybrilit.jinr.ru ] || [ -d /eos/hybrilit.jinr.ru ]
  16. then
  17. export JOB_MANAGER=SLURM_GOVORUN
  18. fi
  19. filename=${BASH_SOURCE}
  20. pathname=`readlink -f $filename`
  21. export SimDataPath=`dirname $pathname`
  22. #####################################
  23. if [ $JOB_MANAGER == 'SGE' ]
  24. then
  25. export ROOT_SOURCE_PATH= #/opt/fairsoft/bmn/may18p1/bin/thisroot.sh
  26. export MCINI_PATH=/scratch2/parfenov/Soft/mcini-new
  27. export DCM_MODEL_PATH=/scratch2/parfenov/Soft/dcmqgsmfragments
  28. export JAM_MODEL_PATH=/scratch2/parfenov/Soft/jam-1.90596
  29. export SMASH_MODEL_PATH=/scratch2/parfenov/Soft/smash-2.1.1/build/
  30. export URQMD_MODEL_PATH=/scratch2/parfenov/Soft/urqmd-3.4
  31. elif [ $JOB_MANAGER == 'SLURM' ]
  32. then
  33. export ROOT_SOURCE_PATH=/cvmfs/fairsoft.gsi.de/debian10/fairsoft/jun19p2/bin/thisroot.sh
  34. export MCINI_PATH=/lustre/nyx/hades/user/parfenov/Soft/mcini
  35. export DCM_MODEL_PATH=/lustre/nyx/hades/user/parfenov/mc/macros/submit_botvina/dcmqgsmfragments
  36. export JAM_MODEL_PATH=/lustre/nyx/hades/user/parfenov/Soft/jam-1.90596
  37. export SMASH_MODEL_PATH=/lustre/nyx/hades/user/parfenov/Soft/Models/SMASH/smash-2.0.1/build
  38. export URQMD_MODEL_PATH=/lustre/nyx/hades/user/parfenov/Soft/urqmd-3.4
  39. elif [ $JOB_MANAGER == 'SLURM_MEPHI' ]
  40. then
  41. export ROOT_SOURCE_PATH=/mnt/pool/nica/5/parfenovpeter/Soft/Cherenkov/ROOT/build-cxx11/bin/thisroot.sh
  42. export MCINI_PATH=/mnt/pool/nica/5/parfenovpeter/Soft/Cherenkov/mcini
  43. export DCM_MODEL_PATH=/mnt/pool/nica/5/parfenovpeter/Soft/Cherenkov/dcmqgsmfragments
  44. export JAM_MODEL_PATH=/mnt/pool/nica/5/parfenovpeter/Soft/Cherenkov/jam-1.90596
  45. export SMASH_MODEL_PATH=/mnt/pool/nica/5/parfenovpeter/Soft/Cherenkov/smash-2.0.2/build
  46. export URQMD_MODEL_PATH=/mnt/pool/nica/5/parfenovpeter/Soft/Cherenkov/urqmd-3.4
  47. elif [ $JOB_MANAGER == 'SLURM_GOVORUN' ]
  48. then
  49. export ROOT_SOURCE_PATH= #/lustre/stor1/parfenov/Soft/ROOT/build-cxx11/bin/thisroot.sh
  50. export MCINI_PATH=/lustre/stor1/parfenov/Soft/mcini
  51. export DCM_MODEL_PATH=/lustre/stor1/parfenov/Soft/dcmqgsmfragments
  52. export JAM_MODEL_PATH=/lustre/stor1/parfenov/Soft/jam-1.90596
  53. export SMASH_MODEL_PATH=/zfs/hybrilit.jinr.ru/user/p/parfenov/Soft/smash-1.8.1/build
  54. export URQMD_MODEL_PATH=/lustre/stor1/parfenov/Soft/urqmd-3.4
  55. fi
  56. #####################################
  57. echo "Job manager = ${JOB_MANAGER}"
  58. echo "SimDataPath = ${SimDataPath}"
  59. #rsync -vzruP ${SimDataPath}/templates/* ${SimDataPath}/
  60. if [[ $JOB_MANAGER == SGE ]]
  61. then
  62. JOBID='$JOB_ID'
  63. TASKID='$SGE_TASK_ID'
  64. fi
  65. if [[ $JOB_MANAGER == SLURM ]]
  66. then
  67. JOBID='$SLURM_ARRAY_JOB_ID'
  68. TASKID='$SLURM_ARRAY_TASK_ID'
  69. fi
  70. if [[ $JOB_MANAGER == SLURM_MEPHI ]]
  71. then
  72. JOBID='$SLURM_ARRAY_JOB_ID'
  73. TASKID='$SLURM_ARRAY_TASK_ID'
  74. fi
  75. if [[ $JOB_MANAGER == SLURM_GOVORUN ]]
  76. then
  77. JOBID='$SLURM_ARRAY_JOB_ID'
  78. TASKID='$SLURM_ARRAY_TASK_ID'
  79. fi
  80. ### DCM-QGSM-SMM
  81. MODEL_NAME=DCM-QGSM-SMM
  82. echo "Configuring ${MODEL_NAME}"
  83. mkdir -p ${SimDataPath}/${MODEL_NAME}/scripts
  84. mkdir -p ${SimDataPath}/${MODEL_NAME}/inputfile
  85. mkdir -p ${SimDataPath}/${MODEL_NAME}/TMP
  86. mkdir -p ${SimDataPath}/${MODEL_NAME}/OUT
  87. sed\
  88. -e 's!_JOB_ID_!'$JOBID'!g'\
  89. -e 's!_TASK_ID_!'$TASKID'!g'\
  90. -e 's!_SIMDATA_PATH_!'$SimDataPath'!g'\
  91. -e 's!_ROOT_SOURCE_PATH_!source '$ROOT_SOURCE_PATH'!g'\
  92. -e 's!_MCINI_PATH_!'$MCINI_PATH'!g'\
  93. -e 's!_DCM_MODEL_PATH_!'$DCM_MODEL_PATH'!g'\
  94. $SimDataPath/templates/${MODEL_NAME}/scripts/start.sh.template > $SimDataPath/${MODEL_NAME}/scripts/start.sh
  95. if [[ $JOB_MANAGER == SGE ]]
  96. then
  97. sed -i "/export JOB_ID=$JOBID/i #\n#$ -wd ${SimDataPath}/${MODEL_NAME}/TMP\n#$ -cwd\n#$ -N run_sim_${MODEL_NAME}\n#$ -q all.q\n#$ -l h_rt=8:00:00\n#$ -l s_rt=8:00:00\n#$ -t 1-100\n#\n#$ -o ${SimDataPath}/${MODEL_NAME}/TMP\n#$ -e ${SimDataPath}/${MODEL_NAME}/TMP\n#\nsource /cvmfs/nica.jinr.ru/sw/os/login.sh\nmodule add CMake ROOT\n" $SimDataPath/${MODEL_NAME}/scripts/start.sh
  98. fi
  99. if [[ $JOB_MANAGER == SLURM ]]
  100. then
  101. sed -i "/export JOB_ID=$JOBID/i #\n#SBATCH -D ${SimDataPath}/${MODEL_NAME}/TMP\n#SBATCH -J run_sim_${MODEL_NAME}\n#SBATCH -p main\n#SBATCH --time=05:00:00\n#SBATCH -a 1-100\n#\n#SBATCH -o ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.out\n#SBATCH -e ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.err\n#\n" $SimDataPath/${MODEL_NAME}/scripts/start.sh
  102. fi
  103. if [[ $JOB_MANAGER == SLURM_MEPHI ]]
  104. then
  105. sed -i "/export JOB_ID=$JOBID/i #\n#SBATCH -D ${SimDataPath}/${MODEL_NAME}/TMP\n#SBATCH -J run_sim_${MODEL_NAME}\n#SBATCH -p compute\n#SBATCH --time=05:00:00\n#SBATCH -a 1-100\n#\n#SBATCH -o ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.out\n#SBATCH -e ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.err\n#\n" $SimDataPath/${MODEL_NAME}/scripts/start.sh
  106. fi
  107. if [[ $JOB_MANAGER == SLURM_GOVORUN ]]
  108. then
  109. sed -i "/export JOB_ID=$JOBID/i #\n#SBATCH -D ${SimDataPath}/${MODEL_NAME}/TMP\n#SBATCH -J run_sim_${MODEL_NAME}\n#SBATCH -p mephi\n#SBATCH --time=05:00:00\n#SBATCH -a 1-100\n#\n#SBATCH -o ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.out\n#SBATCH -e ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.err\n#\nmodule add FairRoot/v18.2.0_gcc485\n" $SimDataPath/${MODEL_NAME}/scripts/start.sh
  110. fi
  111. rsync -vuzP ${SimDataPath}/templates/${MODEL_NAME}/inputfile/* ${SimDataPath}/${MODEL_NAME}/inputfile/
  112. chmod +x ${SimDataPath}/${MODEL_NAME}/scripts/start.sh
  113. ### JAM
  114. MODEL_NAME=JAM
  115. echo "Configuring ${MODEL_NAME}"
  116. mkdir -p ${SimDataPath}/${MODEL_NAME}/scripts
  117. mkdir -p ${SimDataPath}/${MODEL_NAME}/inputfile
  118. mkdir -p ${SimDataPath}/${MODEL_NAME}/TMP
  119. mkdir -p ${SimDataPath}/${MODEL_NAME}/OUT
  120. sed\
  121. -e 's!_JOB_ID_!'$JOBID'!g'\
  122. -e 's!_TASK_ID_!'$TASKID'!g'\
  123. -e 's!_SIMDATA_PATH_!'$SimDataPath'!g'\
  124. -e 's!_ROOT_SOURCE_PATH_!source '$ROOT_SOURCE_PATH'!g'\
  125. -e 's!_MCINI_PATH_!'$MCINI_PATH'!g'\
  126. -e 's!_JAM_MODEL_PATH_!'$JAM_MODEL_PATH'!g'\
  127. $SimDataPath/templates/${MODEL_NAME}/scripts/start.sh.template > $SimDataPath/${MODEL_NAME}/scripts/start.sh
  128. if [[ $JOB_MANAGER == SGE ]]
  129. then
  130. sed -i "/export JOB_ID=$JOBID/i #\n#$ -wd ${SimDataPath}/${MODEL_NAME}/TMP\n#$ -cwd\n#$ -N run_sim_${MODEL_NAME}\n#$ -q all.q\n#$ -l h=!(ncx182.jinr.ru|ncx211.jinr.ru)\n#$ -l h_rt=8:00:00\n#$ -l s_rt=8:00:00\n#$ -t 1-100\n#\n#$ -o ${SimDataPath}/${MODEL_NAME}/TMP\n#$ -e ${SimDataPath}/${MODEL_NAME}/TMP\n#\nsource /cvmfs/nica.jinr.ru/sw/os/login.sh\nmodule add ROOT/v6-24-06-3\n" $SimDataPath/${MODEL_NAME}/scripts/start.sh
  131. fi
  132. if [[ $JOB_MANAGER == SLURM ]]
  133. then
  134. sed -i "/export JOB_ID=$JOBID/i #\n#SBATCH -D ${SimDataPath}/${MODEL_NAME}/TMP\n#SBATCH -J run_sim_${MODEL_NAME}\n#SBATCH -p main\n#SBATCH --time=05:00:00\n#SBATCH -a 1-100\n#\n#SBATCH -o ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.out\n#SBATCH -e ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.err\n#\n" $SimDataPath/${MODEL_NAME}/scripts/start.sh
  135. fi
  136. if [[ $JOB_MANAGER == SLURM_MEPHI ]]
  137. then
  138. #sed -i "/export JOB_ID=$JOBID/i #\n#SBATCH -D ${SimDataPath}/${MODEL_NAME}/TMP\n#SBATCH -J run_sim_${MODEL_NAME}\n#SBATCH -p compute\n#SBATCH --time=05:00:00\n#SBATCH -a 1-100\n#\n#SBATCH -o ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.out\n#SBATCH -e ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.err\n#\n" $SimDataPath/${MODEL_NAME}/scripts/start.sh
  139. sed -i "/export JOB_ID=$JOBID/i #\n#SBATCH -D ${SimDataPath}/${MODEL_NAME}/TMP\n#SBATCH -J run_sim_${MODEL_NAME}\n#SBATCH -p compute\n#SBATCH --time=05:00:00\n#SBATCH -a 1-100\n#\n#SBATCH -o ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.out\n#SBATCH -e ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.err\n#\n" $SimDataPath/${MODEL_NAME}/scripts/start.sh
  140. fi
  141. if [[ $JOB_MANAGER == SLURM_GOVORUN ]]
  142. then
  143. sed -i "/export JOB_ID=$JOBID/i #\n#SBATCH -D ${SimDataPath}/${MODEL_NAME}/TMP\n#SBATCH -J run_sim_${MODEL_NAME}\n#SBATCH -p mephi\n#SBATCH --time=05:00:00\n#SBATCH -a 1-100\n#\n#SBATCH -o ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.out\n#SBATCH -e ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.err\n#\nmodule add FairRoot/v18.2.0_gcc485\n" $SimDataPath/${MODEL_NAME}/scripts/start.sh
  144. fi
  145. rsync -vuzP ${SimDataPath}/templates/${MODEL_NAME}/scripts/jam.cfg.template ${SimDataPath}/${MODEL_NAME}/scripts/jam.cfg.template
  146. chmod +x ${SimDataPath}/${MODEL_NAME}/scripts/start.sh
  147. ### SMASH
  148. MODEL_NAME=SMASH
  149. echo "Configuring ${MODEL_NAME}"
  150. #export ROOT_SOURCE_PATH=/opt/fairsoft/bmn/may18p1/bin/thisroot.sh
  151. #export MCINI_PATH=/scratch2/parfenov/Soft/mcini
  152. mkdir -p ${SimDataPath}/${MODEL_NAME}/scripts
  153. mkdir -p ${SimDataPath}/${MODEL_NAME}/inputfile
  154. mkdir -p ${SimDataPath}/${MODEL_NAME}/TMP
  155. mkdir -p ${SimDataPath}/${MODEL_NAME}/OUT
  156. sed\
  157. -e 's!_JOB_ID_!'$JOBID'!g'\
  158. -e 's!_TASK_ID_!'$TASKID'!g'\
  159. -e 's!_SIMDATA_PATH_!'$SimDataPath'!g'\
  160. -e 's!_ROOT_SOURCE_PATH_!source '$ROOT_SOURCE_PATH'!g'\
  161. -e 's!_MCINI_PATH_!'$MCINI_PATH'!g'\
  162. -e 's!_SMASH_MODEL_PATH_!'$SMASH_MODEL_PATH'!g'\
  163. $SimDataPath/templates/${MODEL_NAME}/scripts/start.sh.template > $SimDataPath/${MODEL_NAME}/scripts/start.sh
  164. if [[ $JOB_MANAGER == SGE ]]
  165. then
  166. sed -i "/export JOB_ID=$JOBID/i #\n#$ -wd ${SimDataPath}/${MODEL_NAME}/TMP\n#$ -cwd\n#$ -N run_sim_${MODEL_NAME}\n#$ -q all.q\n#$ -l h_rt=8:00:00\n#$ -l s_rt=8:00:00\n#$ -t 1-100\n#\n#$ -o ${SimDataPath}/${MODEL_NAME}/TMP\n#$ -e ${SimDataPath}/${MODEL_NAME}/TMP\n#\n" $SimDataPath/${MODEL_NAME}/scripts/start.sh
  167. fi
  168. if [[ $JOB_MANAGER == SLURM ]]
  169. then
  170. sed -i "/export JOB_ID=$JOBID/i #\n#SBATCH -D ${SimDataPath}/${MODEL_NAME}/TMP\n#SBATCH -J run_sim_${MODEL_NAME}\n#SBATCH -p main\n#SBATCH --time=05:00:00\n#SBATCH -a 1-100\n#\n#SBATCH -o ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.out\n#SBATCH -e ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.err\n#\n" $SimDataPath/${MODEL_NAME}/scripts/start.sh
  171. fi
  172. if [[ $JOB_MANAGER == SLURM_MEPHI ]]
  173. then
  174. sed -i "/export JOB_ID=$JOBID/i #\n#SBATCH -D ${SimDataPath}/${MODEL_NAME}/TMP\n#SBATCH -J run_sim_${MODEL_NAME}\n#SBATCH -p compute\n#SBATCH --time=05:00:00\n#SBATCH -a 1-100\n#\n#SBATCH -o ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.out\n#SBATCH -e ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.err\n#\n" $SimDataPath/${MODEL_NAME}/scripts/start.sh
  175. fi
  176. if [[ $JOB_MANAGER == SLURM_GOVORUN ]]
  177. then
  178. sed -i "/export JOB_ID=$JOBID/i #\n#SBATCH -D ${SimDataPath}/${MODEL_NAME}/TMP\n#SBATCH -J run_sim_${MODEL_NAME}\n#SBATCH -p mephi\n#SBATCH --time=05:00:00\n#SBATCH -a 1-100\n#\n#SBATCH -o ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.out\n#SBATCH -e ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.err\n#\nmodule add FairRoot/v18.2.0_gcc485\n" $SimDataPath/${MODEL_NAME}/scripts/start.sh
  179. fi
  180. rsync -vuzP ${SimDataPath}/templates/${MODEL_NAME}/inputfile/config.yaml ${SimDataPath}/${MODEL_NAME}/inputfile/config.yaml
  181. chmod +x ${SimDataPath}/${MODEL_NAME}/scripts/start.sh
  182. ### UrQMD
  183. MODEL_NAME=UrQMD
  184. echo "Configuring ${MODEL_NAME}"
  185. mkdir -p ${SimDataPath}/${MODEL_NAME}/scripts
  186. mkdir -p ${SimDataPath}/${MODEL_NAME}/inputfile
  187. mkdir -p ${SimDataPath}/${MODEL_NAME}/TMP
  188. mkdir -p ${SimDataPath}/${MODEL_NAME}/OUT
  189. sed\
  190. -e 's!_JOB_ID_!'$JOBID'!g'\
  191. -e 's!_TASK_ID_!'$TASKID'!g'\
  192. -e 's!_SIMDATA_PATH_!'$SimDataPath'!g'\
  193. -e 's!_ROOT_SOURCE_PATH_!source '$ROOT_SOURCE_PATH'!g'\
  194. -e 's!_MCINI_PATH_!'$MCINI_PATH'!g'\
  195. -e 's!_URQMD_MODEL_PATH_!'$URQMD_MODEL_PATH'!g'\
  196. $SimDataPath/templates/${MODEL_NAME}/scripts/start.sh.template > $SimDataPath/${MODEL_NAME}/scripts/start.sh
  197. if [[ $JOB_MANAGER == SGE ]]
  198. then
  199. sed -i "/export JOB_ID=$JOBID/i #\n#$ -wd ${SimDataPath}/${MODEL_NAME}/TMP\n#$ -cwd\n#$ -N run_sim_${MODEL_NAME}\n#$ -q all.q\n#$ -l h_rt=8:00:00\n#$ -l s_rt=8:00:00\n#$ -t 1-100\n#\n#$ -o ${SimDataPath}/${MODEL_NAME}/TMP\n#$ -e ${SimDataPath}/${MODEL_NAME}/TMP\n#\n" $SimDataPath/${MODEL_NAME}/scripts/start.sh
  200. fi
  201. if [[ $JOB_MANAGER == SLURM ]]
  202. then
  203. sed -i "/export JOB_ID=$JOBID/i #\n#SBATCH -D ${SimDataPath}/${MODEL_NAME}/TMP\n#SBATCH -J run_sim_${MODEL_NAME}\n#SBATCH -p main\n#SBATCH --time=05:00:00\n#SBATCH -a 1-100\n#\n#SBATCH -o ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.out\n#SBATCH -e ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.err\n#\n" $SimDataPath/${MODEL_NAME}/scripts/start.sh
  204. fi
  205. if [[ $JOB_MANAGER == SLURM_MEPHI ]]
  206. then
  207. sed -i "/export JOB_ID=$JOBID/i #\n#SBATCH -D ${SimDataPath}/${MODEL_NAME}/TMP\n#SBATCH -J run_sim_${MODEL_NAME}\n#SBATCH -p compute\n#SBATCH --time=05:00:00\n#SBATCH -a 1-100\n#\n#SBATCH -o ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.out\n#SBATCH -e ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.err\n#\n" $SimDataPath/${MODEL_NAME}/scripts/start.sh
  208. fi
  209. if [[ $JOB_MANAGER == SLURM_GOVORUN ]]
  210. then
  211. sed -i "/export JOB_ID=$JOBID/i #\n#SBATCH -D ${SimDataPath}/${MODEL_NAME}/TMP\n#SBATCH -J run_sim_${MODEL_NAME}\n#SBATCH -p mephi\n#SBATCH --time=05:00:00\n#SBATCH -a 1-100\n#\n#SBATCH -o ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.out\n#SBATCH -e ${SimDataPath}/${MODEL_NAME}/TMP/slurm_%A_%a.err\n#\nmodule add FairRoot/v18.2.0_gcc485\n" $SimDataPath/${MODEL_NAME}/scripts/start.sh
  212. fi
  213. rsync -vuzP ${SimDataPath}/templates/${MODEL_NAME}/scripts/inputfile.template ${SimDataPath}/${MODEL_NAME}/scripts/inputfile.template
  214. chmod +x ${SimDataPath}/${MODEL_NAME}/scripts/start.sh