- Timestamp:
- Nov 7, 2024, 10:27:18 AM (2 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/deftank/lib_launchPEM.sh
r3446 r3495 32 32 submit_job="sbatch --parsable" 33 33 submit_dependjob="sbatch --parsable --dependency" 34 sed -i 's/\$PBS_JOBID/\$SLURM_JOB_ID/g' PEMrun.job35 34 elif command -v qstat &> /dev/null; then 36 35 echo "PBS/TORQUE is installed on $machine." … … 39 38 submit_job="qsub" 40 39 submit_dependjob="qsub -W depend" 41 sed -i 's/\$SLURM_JOB_ID/\$PBS_JOBID/g' PEMrun.job42 40 else 43 41 echo "Error: neither SLURM nor TORQUE/PBS is installed on $machine!" … … 119 117 mkdir diags 120 118 fi 121 if [ $ dim -ne 1]; then119 if [ $mode -ne 0 ]; then 122 120 job_scheduler 123 121 fi … … 161 159 162 160 # To submit the PCM runs 163 # arg1: model dimension161 # arg1: launching mode 164 162 # arg2: number of PCM runs to launch 165 163 # arg3: local number of the PCM run from which to start (optional) … … 172 170 if [ $i_myear -lt $n_myear ]; then 173 171 echo "Run PCM $iPCM: call $ii/$2..." 174 if [ $1 -eq 1 ]; then # 1D model172 if [ $1 -eq 0 ]; then # Mode: processing scripts 175 173 sed -i "s/^k=[0-9]\+$/k=$(echo "3 - $nPCM_ini" | bc)/" PCMrun.job 176 174 ./PCMrun.job … … 178 176 errlaunch 179 177 fi 180 else # 3D model178 else # Mode: launching jobs 181 179 cp PCMrun.job PCMrun${iPCM}.job 182 180 sed -i -E "s/($name_job[^0-9]*[0-9]*[^0-9]*)[0-9]+$/\1${iPCM}/" PCMrun${iPCM}.job … … 197 195 if [ $i_myear -lt $n_myear ]; then 198 196 echo "Run PCM $iPCM: call $i/$2..." 199 if [ $1 -eq 1 ]; then # 1D model197 if [ $1 -eq 0 ]; then # Mode: processing scripts 200 198 sed -i "s/^k=[0-9]\+$/k=$(echo "$i + 2 - $nPCM_ini" | bc)/" PCMrun.job 201 199 ./PCMrun.job … … 203 201 errlaunch 204 202 fi 205 else # 3D model203 else # Mode: launching jobs 206 204 cp PCMrun.job PCMrun${iPCM}.job 207 205 sed -i -E "s/($name_job[^0-9]*[0-9]*[^0-9]*)[0-9]+$/\1${iPCM}/" PCMrun${iPCM}.job … … 219 217 220 218 # To submit the PEM run 221 # arg1: model dimension219 # arg1: launching mode 222 220 submitPEM() { 223 221 if [ $i_myear -lt $n_myear ]; then 224 222 echo "Run PEM $iPEM" 225 if [ $1 -eq 1 ]; then # 1D model223 if [ $1 -eq 0 ]; then # Mode: processing scripts 226 224 ./PEMrun.job 227 225 if [ $? -ne 0 ]; then 228 226 errlaunch 229 227 fi 230 else # 3D model228 else # Mode: launching jobs 231 229 sed -i -E "s/($name_job[^0-9]*[0-9]*[^0-9]*)[0-9]+$/\1${iPEM}/" PEMrun.job 232 230 jobID=$(eval "$submit_job PEMrun.job") … … 242 240 243 241 # To make one cycle of PCM and PEM runs 244 # arg1: model dimension242 # arg1: launching mode 245 243 # arg2: number of PCM runs to launch 246 244 # arg3: local number of the PCM run from which to start (optional) … … 252 250 if [ $i_myear -lt $n_myear ]; then 253 251 echo "Run PEM $iPEM" 254 if [ $1 -eq 1 ]; then # 1D model252 if [ $1 -eq 0 ]; then # Mode: processing scripts 255 253 ./PEMrun.job 256 254 if [ $? -ne 0 ]; then 257 255 errlaunch 258 256 fi 259 else # 3D model257 else # Mode: launching jobs 260 258 sed -i -E "s/($name_job[^0-9]*[0-9]*[^0-9]*)[0-9]+$/\1${iPEM}/" PEMrun.job 261 259 jobID=$(eval "$submit_dependjob=afterok:${jobID} PEMrun.job") … … 293 291 294 292 # To relaunch from PCM run 295 # arg1: model dimension293 # arg1: launching mode 296 294 relaunchPCM() { 297 295 iPCM=$(($irelaunch + 1)) … … 361 359 362 360 # To relaunch from PEM run 363 # arg1: model dimension361 # arg1: launching mode 364 362 relaunchPEM() { 365 363 iPEM=$(echo "$irelaunch + 1" | bc)
Note: See TracChangeset
for help on using the changeset viewer.