COMSOL

COMSOL Multiphysics (formerly FEMLAB) is a finite element analysis and solver software package for various physics and engineering applications, especially coupled phenomena, or multiphysics. owned and supported by COMSOL, Inc.

Availability & Compatibility

COMSOL is available on the Oakley and Glenn clusters.

The versions currently available at OSC are

Version GLENN OAKLEY
3.4 X  
3.5a X  
4.0 X  
4.0a X  
4.1 X  
4.2 X  
4.2a X X
4.3 X X
4.3a   X

Usage

Access

COMSOL is for academic use only.  To use COMSOL you will have to be added to the license server first.  Please contact OSC Help to be added.

Setup

Use module avail to view available modules for a given machine. To select a particular software version, type: module load software-name.
For example: To select COMSOL version 4.2a on Oakley, type: module load comsol/42a

Batch Usage

Sample Batch Script (single processor analysis)

When you log into oakley.osc.edu or glenn.osc.edu you are actually logged into a linux box referred to as the login node. To gain access to the 4000+ processors in the computing environment, you must submit your COMSOL analysis to the batch system for execution. For example, assume that you have had a comsol script file mycomsol.m in the direcory $PBS_O_WORKDIR. In this directory you should create a batch script that would contain the following information:

#PBS -N COMSOL
#PBS -l walltime=1:00:00
#PBS -l nodes=1:ppn=1
#PBS -j oe
#
# The following lines set up the COMSOL environment
#
module load comsol
#
# Move to the directory where the job was submitted
#
cd $PBS_O_WORKDIR
cp *.m $TMPDIR
cd $TMPDIR
#
# Run COMSOL
#
comsol batch mycomsol
#
# Now, copy data (or move) back once the simulation has completed
#
cp * $PBS_O_WORKDIR

Sample Batch Script (Parallel) for COMSOL 4.2a and earlier

The following is a sample batch script which can be submitted for running COMSOL software in Parallel

  • Set nodes to 2 and ppn to 12
  • Copy files from your directory to $TMPDIR
  • Run mpdboot
  • Provide the name of the input file and output file.
  • Set ppn=8 on Glenn
  • Set ppn=12 on Oakley
#PBS -l walltime=01:00:00
#PBS -l nodes=2:ppn=12
#PBS -N COMSOL
#PBS -j oe
#PBS -r n

cd ${PBS_O_WORKDIR}

module load comsol

echo "--- Copy Input Files to TMPDIR and Change Disk to TMPDIR"
pbsdcp *.m* $TMPDIR
cd $TMPDIR

np=12
echo "--- Running on ${np} processes (cores) on the following nodes:"
cat $PBS_NODEFILE | uniq

echo "---- mpd BOOT"
comsol -nn 2 mpd boot -f $PBS_NODEFILE

echo "--- mpd TRACE"
comsol mpd trace

echo "--- COMSOL run"
comsol -nn 2 -np ${np} batch -inputfile input_cluster.mph -outputfile output_cluster.mph

echo "--- mpd ALLEXIT"
comsol mpd allexit

echo "--- Copy files back"
pbsdcp *.m* ${PBS_O_WORKDIR}

echo "---Job finished at: 'date'"
echo "---------------------------------------------" 

Sample Batch Script (Parallel) for COMSOL 4.3

As of version 4.3, it is not necessary to start up MPD before launching a COMSOL job.The following is a sample batch script which can be submitted for running COMSOL 4.3 software in Parallel

  • Set nodes to 2 and ppn to 12
  • Copy files from your directory to $TMPDIR
  • Run mpdboot
  • Provide the name of the input file and output file.
  • Set ppn=8 on Glenn
  • Set ppn=12 on Oakley
#PBS -l walltime=01:00:00
#PBS -l nodes=2:ppn=12
#PBS -N COMSOL
#PBS -j oe
#PBS -r n

cd ${PBS_O_WORKDIR}

module load comsol

echo "--- Copy Input Files to TMPDIR and Change Disk to TMPDIR"
pbsdcp *.m* $TMPDIR
cd $TMPDIR

np=12
echo "--- Running on ${np} processes (cores) on the following nodes:"
cat $PBS_NODEFILE | uniq > hostfile

echo "--- COMSOL run"
comsol -nn 2 -np ${np} batch -f hostfile -mpirsh rsh -inputfile input_cluster.mph -outputfile output_cluster.mph

echo "--- Copy files back"
pbsdcp *.m* ${PBS_O_WORKDIR}

echo "---Job finished at: 'date'"
echo "---------------------------------------------"

Documentation

Online documentation is available at: http://www.osc.edu/supercomputing/manuals.

See Also

 

Supercomputer: 
Service: