|||
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | #!/bin/bash #SBATCH --partition=debug #SBATCH --qos=240c-1h_debug #SBATCH --nodes=1 #SBATCH --ntasks=2 #SBATCH --job-name="<jobname>" #SBATCH --output="%x.%j.out" # <jobname>.<jobid>.out #SBATCH --mail-type=ALL #SBATCH --mail-user=gridops@asti.dost.gov.ph #SBATCH --requeue ##SBATCH --ntasks-per-node=1 # optional ##SBATCH --mem=24G # optional: mem per node ##SBATCH --error=JobName.%J.err # optional; better to use --output only ## For more `sbatch` options, use `man sbatch` in the HPC, or go to https://slurm.schedmd.com/sbatch.html. ## Set stack size to unlimited. ulimit -s unlimited ## Benchmarking. start_time=$(date +%s.%N) ## Print job parameters. echo "Submitted on $(date)" echo "JOB PARAMETERS" echo "SLURM_JOB_ID : ${SLURM_JOB_ID}" echo "SLURM_JOB_NAME : ${SLURM_JOB_NAME}" echo "SLURM_JOB_NUM_NODES : ${SLURM_JOB_NUM_NODES}" echo "SLURM_JOB_NODELIST : ${SLURM_JOB_NODELIST}" echo "SLURM_NTASKS : ${SLURM_NTASKS}" echo "SLURM_NTASKS_PER_NODE : ${SLURM_NTASKS_PER_NODE}" echo "SLURM_MEM_PER_NODE : ${SLURM_MEM_PER_NODE}" ## Create a unique temporary folder in the node. Using a local temporary folder usually results in faster read/write for temporary files. ## If this results in errors, just change to "no". custom_tmp="yes" if [[ $custom_tmp == "yes" ]]; then JOB_TMPDIR=/tmp/${SLURM_JOB_ID} mkdir -p ${JOB_TMPDIR} export TMPDIR=${JOB_TMPDIR} echo "TMPDIR : $TMPDIR" fi ## Reset modules. module purge module load <module1> [<module2> ...] ## Run your codes/scripts/apps. `srun` is optional. [srun] /path/to/exe1 <arg1> ... [srun] /path/to/exe2 <arg2> ... ## Flush the TMPDIR. if [[ $custom_tmp == "yes" ]]; then rm -rf $TMPDIR echo "Cleared the \$TMPDIR [${TMPDIR}]" fi ## Benchmarking end_time=$(date +%s.%N) echo "Finished on $(date)" run_time=$(python -c "print($end_time - $start_time)") echo "Total runtime (sec): ${run_time}" |
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-9-25 20:56
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社