How to use Comsol

Software
Version
Cluster
Comsol
6.0
Dardel

Running Comsol on Dardel

To submit a job on single node (containing 128 cores), you can do so by creating a simple script (comsol_run.sh) which includes:

#!/bin/bash
# The -l above is required to get the full environment with modules 

# Set job name
#SBATCH -J my_job

# 10 hours wall-clock time will be given to this job
#SBATCH -t 10:00:00

# Set the partition for your job. 
#SBATCH -p <partition>

# set the project to be charged for this
#SBATCH -A <your allocation>

# Number of nodes(every node has 128 cores)
#SBATCH --nodes=1

#SBATCH -e error_file.e%J
#SBATCH -o output_file.o%J

# load comsol module
module load PDC
module add comsol/6.0


export LM_LICENSE_FILE=<your license server>

work_dir=$(pwd)/temp
pref_dir=$work_dir/prefs
conf_dir=$pref_dir/configuration
data_dir=$pref_dir/data
rec_dir=$work_dir/recovery
tmp_dir=$work_dir/tmp


mkdir -p $pref_dir
mkdir -p $rec_dir
mkdir -p $tmp_dir
mkdir -p $conf_dir


comsol batch -np 32 -prefsdir $pref_dir -configuration ${conf_dir}/conf.${SLURM_JOBID} -data ${data_dir}/data.${SLURM_JOBID} -recoverydir ${rec_dir} -tmpdir ${tmp_dir} -inputfile  input.mph -outputfile output.mph -batchlog my_output_file.${SLURM_JOBID}

and submit the script on the login node:

$ sbatch comsol_run.sh

You can control number of cores by -np option.

It is recommended to clear temp directory after your simulations since it can cause your storage go above quota and you lose write permissions

Disclaimer

PDC takes no responsibility for the correctness of results produced with the binaries. Always evaluate the binaries against known results for the systems and properties you are investigating before using the binaries for production jobs.