Star-CCM+/en: Difference between revisions

Updating to match new version of source page
(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 --account=def-group  # Specify some account
#SBATCH --time=0-00:30        # Time limit: d-hh:mm
#SBATCH --time=00-01:00      # Time limit: dd-hh:mm
#SBATCH --nodes=2
#SBATCH --nodes=2             # Specify 1 or more nodes
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=40   # or 80 to use HyperThreading
#SBATCH --cpus-per-task=40
#SBATCH --ntasks-per-node=1  # Do not change this value
#SBATCH --mail-type=BEGIN
 
#SBATCH --mail-type=END
cd $SLURM_SUBMIT_DIR
cd $SLURM_SUBMIT_DIR


module purge --force
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/14.06.013-R8
module load starccm/13.06.012-R8
 
export LM_PROJECT='YOUR CD-ADAPCO PROJECT ON DEMAND KEY GOES HERE'
export CDLMD_LICENSE_FILE="1999@localhost"
ssh nia-gw -L 1999:flex.cd-adapco.com:1999 -L 2099:flex.cd-adapco.com:2099 -N -f
 
export STARCCM_TMP="${SCRATCH}/.starccm-${EBVERSIONSTARCCM}"
mkdir -p "$STARCCM_TMP"
 
# ln -s $STARCCM_TMP $HOME  ### only the first time you run the script
 
slurm_hl2hl.py --format STAR-CCM+ > machinefile


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+ -batch -power -np $NCORE -podkey $LM_PROJECT -licpath $CDLMD_LICENSE_FILE -machinefile $PWD/machinefile $PWD/your-file.sim
# 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>
38,760

edits