Child pages
  • How to run Comsol on FAS Odyssey (SEAS users only)

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
#!/bin/bash 
#
#SBATCH -n 8        # Number of cores 
#SBATCH -N 1        # Number of nodes (all cores will be on this node)
#SBATCH -t 0-1:00   # Runtime in D-HH:MM format 
#SBATCH -p general  # Partition to submit to 
#
# Memory per CPU for multinode/MPI work
# use --mem= for single node work, and specify -N 1
#SBATCH --mem-per-cpu=500 #Memory per cpu in MB (see also --mem) 

module load comsol/5.3a4-fasrc01
 
# To run with an older module (example):
# source new-modules.sh
# module load legacy

#For an earlier version:
#module load centos6
#source new-modules.sh
#module load legacy
# module load seas/comsol5.1
# The input file, for example, is assumed to be a COMSOL generated
# file called 'busbar.mph'.

INPUT_FILENAME=busbar.mph
OUTPUT_FILENAME=busbar_out.mph
OUTLOG=busbar_out.log
SCRATCH_DIR=.

# use $SLURM_NTASKS env set by #SBATCH -n value
export COMSOL_NUM_THREADS=$SLURM_NTASKS
comsol batch -np $COMSOL_NUM_THREADS -inputfile $INPUT_FILENAME -outputfile $OUTPUT_FILENAME -batchlog $OUTLOG

# Report some useful info
/bin/uname -a

date

exit

...