1. Home
  2. Docs
  3. Applications
  4. Comsol

Comsol

We provide an example Comsol submission script, run_comsol, in the /nfs/apps/Submission directory. You should not need to edit the submission.  Comsol requires a graphical session.

You can use the comstat command from the login systems to monitor the Comsol license availability.

You need export your DISPLAY, where N is your login system, and XX is your display number, then use sbatch to request an allocation for Comsol. 

Comsol Multiphysics is a FEA, solver and simulation code available on the HPCEE system.  There are a limited number of licenses available to the entire user group, you can view the license availability and status using the

comstat

command from any login node.  The most important output of this command is the comsol and comsolgui features which are required to launch any graphical instance of Comsol.

Launching Comsol on GPU Nodes

There are sample submission scripts in the /nfs/apps/Submissions directory you can use to launch Comsol Multiphysics.  You will want to use the one called run_comsol, most of the default options can be use

##Accounting
#SBATCH --partition=gpu
#SBATCH --qos=normal

##Submission
#SBATCH --nodes=1
#SBATCH --job-name="comsol"

This requests a single node in the GPU queue which contain 2 Nvidia P100 GPUs and local X displays, the GPU and POST queues are the optimal location to use Comsol.

##Load Modules
module load vgl comsol/5.4

This loads the environment module for the version of Comsol you want to use, here Comsol 5.4 is being loaded, other versions are available, please view the Modules documentation for further information using modules.

##Run the parallel job
vglrun comsol -3drend ogl

This line launches comsol with the accelerated graphics prefix vglrun.

Exporting the Display and Starting Comsol

Once you have made the necessary changes to your submission script you need to export your DISPLAY.  Typically Comsol is run in graphical mode and the DISPLAY environment tells Comsol where your DISPLAY is located.  Your display will be listed in the title bar of the TurboVNC graphical interface, an example would be login06:10, the 10th display on the login06 system, export your DISPLAY using the following command from your login node

export DISPLAY="loginX:YY"

Where X is your login node number and YY is your display number.  Once this is set you can submit your Fluent submission script to the queue and if there are sufficient licenses for it to start you will see Fluent spawn on your display, submit the job as follows

login:~> sbatch run_comsol

Your job should begin shortly.

Comsol in Parallel

To run Comsol in non-interactive parallel mode use sample submission script called run_comsol_parallel, most of the default options can be used, the options you may want to change:

##Accounting
#SBATCH --partition=gpu
#SBATCH --qos=normal

##Submission
#SBATCH --nodes=2
#SBATCH --job-name="comsol"

This requests 2 nodes, 80 cores in the GPU queue.

##Load Modules
module load vgl comsol/5.4

This loads the environment module for the version of Comsol you want to use, here Comsol 5.4 is being loaded, other versions are available, please view the Modules documentation for further information using modules.

##Run the parallel job
comsol -clustersimple batch in.mph -output out.mph

This line launches Comsol, you can change the names of the in and out files, note that these will need to have been created for your parallel job by using Comsol in graphical mode.

login:~> sbatch run_comsol_parallel

Your job should begin shortly.