Changeset 3403 for trunk/LMDZ.COMMON/libf/evolution/deftank
- Timestamp:
- Aug 9, 2024, 6:09:15 PM (5 months ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution/deftank
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/deftank/PCMrun.job
r3391 r3403 10 10 #SBATCH --threads-per-core=1 # --hint=nomultithread 11 11 ###SBATCH --exclusive 12 #SBATCH --output=jobPCM_% A.out12 #SBATCH --output=jobPCM_%j.out 13 13 #SBATCH --time=12:00:00 14 14 … … 17 17 source ../trunk/LMDZ.COMMON/arch.env 18 18 19 # Number of threads to use (must be the same as '#MSUB -c'above)20 export OMP_NUM_THREADS= 419 # Number of threads to use (must be the same as "#SBATCH --cpus-per-task=" above) 20 export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK 21 21 export OMP_STACKSIZE=400M 22 22 … … 24 24 exePCM="gcm_64x48x32_phymars_para.e" 25 25 ######################################################################## 26 27 28 ulimit -s unlimited 26 29 27 30 # Running the PCM -
trunk/LMDZ.COMMON/libf/evolution/deftank/PEMrun.job
r3391 r3403 5 5 #SBATCH --constraint=GENOA 6 6 ### Number of Nodes to use 7 #SBATCH --nodes= 4 # to run with enough memory7 #SBATCH --nodes=1 8 8 #SBATCH --ntasks-per-node=1 9 9 #SBATCH --cpus-per-task=1 10 #SBATCH --threads-per-core=1 # --hint=nomultithread11 10 ###SBATCH --exclusive 12 #SBATCH --output=jobPEM_% A.out11 #SBATCH --output=jobPEM_%j.out 13 12 #SBATCH --time=24:00:00 14 13 … … 24 23 ######################################################################## 25 24 25 26 ulimit -s unlimited 26 27 27 28 # Reshaping PCM data with XIOS -
trunk/LMDZ.COMMON/libf/evolution/deftank/README
r3394 r3403 17 17 18 18 # PCMrun.job: 19 Bash script file to run the PCM with a SLURM job. The name of the PCM executable file should be adapted. The header corresponds to the ADASTRA supercomputer and should be changed for other machines. In case of 1D, the SBATCH headers areomitted.19 Bash script file to submit a PCM job (with SLURM or PBS/TORQUE). The name of the PCM executable file should be adapted. The headers correspond to the ADASTRA supercomputer and should be changed for other machines and job schedulers. In case of 1D, the headers are naturally omitted. 20 20 The path to source the arch file should be adapted to the machine. 21 21 The execution line should also be adapted according to the set-up. 22 22 23 23 # PEMrun.job: 24 Bash script file to run the PEM with a SLURM job. The name of the PEM executable file and Reshaping executable file should be adapted. The header corresponds to the ADASTRA supercomputer and should be changed for other machines. In case of 1D, the SBATCH headers areomitted.24 Bash script file to submit PEM job (with SLURM or PBS/TORQUE). The name of the PEM executable file and Reshaping executable file should be adapted. The headers correspond to the ADASTRA supercomputer and should be changed for other machines and job schedulers. In case of 1D, the headers are naturally omitted. 25 25 The path to source the arch file should be adapted to the machine. 26 26 The execution line should also be adapted according to the set-up. -
trunk/LMDZ.COMMON/libf/evolution/deftank/lib_launchPEM.sh
r3394 r3403 24 24 } 25 25 26 # To check if SLURM is the job scheduler 27 function is_slurm() { 28 if ! command -v squeue &> /dev/null; then 29 echo "Error: the job scheduler is not SLURM on $machine!" 30 echo "You need to adapt the script to your case." 26 # To check what is the job scheduler 27 function job_scheduler() { 28 if command -v squeue &> /dev/null; then 29 echo "SLURM is installed on $machine." 30 name_job="#SBATCH --job-name=" 31 kill_job="scancel" 32 submit_job="sbatch --parsable" 33 submit_dependjob="sbatch --parsable --dependency" 34 sed -i 's/\$PBS_JOBID/\$SLURM_JOB_ID/g' PEMrun.job 35 elif command -v qstat &> /dev/null; then 36 echo "PBS/TORQUE is installed on $machine." 37 name_job="#PBS -N " 38 kill_job="qdel" 39 submit_job="qsub" 40 submit_dependjob="qsub -W depend" 41 sed -i 's/\$SLURM_JOB_ID/\$PBS_JOBID/g' PEMrun.job 42 else 43 echo "Error: neither SLURM nor TORQUE/PBS is installed on $machine!" 44 echo "You need to adapt the script to your job scheduler." 31 45 errlaunch 32 46 fi … … 39 53 LC_NUMERIC=en_US.UTF-8 40 54 41 if [ $dim -ne 1 ]; then # 3D model works only with SLURM for now (because of chained job submission in the script + time limit management)42 is_slurm43 fi44 55 if [ -v n_mars_years ] && [ ! -z "$n_mars_years" ]; then 45 56 if [ $n_mars_years -lt 1 ]; then … … 107 118 if [ ! -d "diags" ]; then 108 119 mkdir diags 120 fi 121 if [ $dim -ne 1 ]; then 122 job_scheduler 109 123 fi 110 124 } … … 160 174 else # 3D model 161 175 cp PCMrun.job PCMrun${iPCM}.job 162 sed -i -E "s/( #SBATCH --job-name=[^0-9]*[0-9]*[^0-9]*)[0-9]+$/\1${iPCM}/" PCMrun${iPCM}.job176 sed -i -E "s/($name_job[^0-9]*[0-9]*[^0-9]*)[0-9]+$/\1${iPCM}/" PCMrun${iPCM}.job 163 177 sed -i "s/^k=[0-9]\+$/k=$(echo "3 - $nPCM_ini" | bc -l)/" PCMrun${iPCM}.job 164 jobID=$( sbatch --parsable PCMrun${iPCM}.job)178 jobID=$(eval "$submit_job PCMrun${iPCM}.job") 165 179 # Create a file to cancel the dependent jobs of the cycle 166 180 echo "#!/bin/bash" > kill_launchPEM.sh 167 181 chmod +x kill_launchPEM.sh 168 echo "scancel"$jobID >> kill_launchPEM.sh182 echo $kill_job $jobID >> kill_launchPEM.sh 169 183 fi 170 184 ((iPCM++)) … … 182 196 else # 3D model 183 197 cp PCMrun.job PCMrun${iPCM}.job 184 sed -i -E "s/( #SBATCH --job-name=[^0-9]*[0-9]*[^0-9]*)[0-9]+$/\1${iPCM}/" PCMrun${iPCM}.job198 sed -i -E "s/($name_job[^0-9]*[0-9]*[^0-9]*)[0-9]+$/\1${iPCM}/" PCMrun${iPCM}.job 185 199 sed -i "s/^k=[0-9]\+$/k=$(echo "$i + 2 - $nPCM_ini" | bc -l)/" PCMrun${iPCM}.job 186 jobID=$( sbatch --parsable --dependency=afterok:${jobID} PCMrun${iPCM}.job)187 echo "scancel"$jobID >> kill_launchPEM.sh200 jobID=$(eval "$submit_dependjob=afterok:${jobID} PCMrun${iPCM}.job") 201 echo $kill_job $jobID >> kill_launchPEM.sh 188 202 fi 189 203 ((iPCM++)) … … 203 217 ./PEMrun.job 204 218 else # 3D model 205 sed -i -E "s/( #SBATCH --job-name=[^0-9]*[0-9]*[^0-9]*)[0-9]+$/\1${iPEM}/" PEMrun.job206 jobID=$( sbatch --parsable PEMrun.job)219 sed -i -E "s/($name_job[^0-9]*[0-9]*[^0-9]*)[0-9]+$/\1${iPEM}/" PEMrun.job 220 jobID=$(eval "$submit_job PEMrun.job") 207 221 # Create a file to cancel the dependent jobs of the cycle 208 222 echo "#!/bin/bash" > kill_launchPEM.sh 209 223 chmod +x kill_launchPEM.sh 210 echo "scancel"$jobID >> kill_launchPEM.sh224 echo $kill_job $jobID >> kill_launchPEM.sh 211 225 fi 212 226 else … … 229 243 ./PEMrun.job 230 244 else # 3D model 231 sed -i -E "s/( #SBATCH --job-name=[^0-9]*[0-9]*[^0-9]*)[0-9]+$/\1${iPEM}/" PEMrun.job232 jobID=$( sbatch --parsable --dependency=afterok:${jobID} PEMrun.job)233 echo "scancel"$jobID >> kill_launchPEM.sh245 sed -i -E "s/($name_job[^0-9]*[0-9]*[^0-9]*)[0-9]+$/\1${iPEM}/" PEMrun.job 246 jobID=$(eval "$submit_dependjob=afterok:${jobID} PEMrun.job") 247 echo $kill_job $jobID >> kill_launchPEM.sh 234 248 fi 235 249 else
Note: See TracChangeset
for help on using the changeset viewer.