38,760
edits
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
Line 135: | Line 135: | ||
|lang="bash" | |lang="bash" | ||
|contents= | |contents= | ||
<pre> | |||
#!/bin/bash | #!/bin/bash | ||
#SBATCH -- | #SBATCH --time=0-00:30 # Time limit: d-hh:mm | ||
#SBATCH --nodes=2 | |||
#SBATCH --nodes=2 | #SBATCH --ntasks-per-node=1 | ||
#SBATCH --cpus-per-task=40 | #SBATCH --cpus-per-task=40 | ||
#SBATCH -- | #SBATCH --mail-type=BEGIN | ||
#SBATCH --mail-type=END | |||
cd $SLURM_SUBMIT_DIR | cd $SLURM_SUBMIT_DIR | ||
ssh nia-gw -L 1999:flex.cd-adapco.com:1999 -L 2099:flex.cd-adapco.com:2099 -N -f | |||
export LM_PROJECT='YOUR CD-ADAPCO PROJECT ID GOES HERE' | |||
export CDLMD_LICENSE_FILE="1999@127.0.0.1" | |||
module load CCEnv | module load CCEnv | ||
module load StdEnv | module load StdEnv | ||
module load starccm/ | module load starccm/13.06.012-R8 | ||
slurm_hl2hl.py --format STAR-CCM+ > $SLURM_SUBMIT_DIR/machinefile_$SLURM_JOB_ID | |||
NCORE=$((SLURM_NTASKS * SLURM_CPUS_PER_TASK)) | NCORE=$((SLURM_NTASKS * SLURM_CPUS_PER_TASK)) | ||
starccm+ - | # Workaround for license failures. | ||
# Try up to 5 times to get starccm+ to start by checking exit status (throws 143 when fails, 0 when works). | |||
i=1 | |||
RET=-1 | |||
while [ $i -le 5 ] && [ $RET -ne 0 ]; do | |||
[ $i -eq 1 ] || sleep 5 | |||
echo "Attempt number: "$i | |||
starccm+ -power -np $NCORE -podkey $LM_PROJECT -machinefile $SLURM_SUBMIT_DIR/machinefile_$SLURM_JOB_ID -batch $SLURM_SUBMIT_DIR/your-simulation-file.java $SLURM_SUBMIT_DIR/your-simulation-file.sim > $SLURM_JOB_ID.results | |||
RET=$? | |||
i=$((i+1)) | |||
done | |||
exit $RET | |||
</pre> | |||
}}</tab> | }}</tab> | ||
</tabs> | </tabs> |