Difference between revisions of "COMSOL"

Line 28: Line 28:
*ECAD Import Module
*ECAD Import Module
*LiveLink for MATLAB
*LiveLink for MATLAB
== Running Jobs via Web Apps ==
The fastest and easiest way to run COMSOL jobs on the CIRCE HPC cluster, is to run them via '''Web Apps'''. Click [https://cwa.rc.usf.edu/cwa_applications/research-computing/54 here] to run COMSOL 5.2a.
Other versions of COMSOL can be found using the '''Web Apps''' tab at the top of the page.
If you need more control over your workflow, keep reading below.


== Running Comsol Jobs on CIRCE ==
== Running Comsol Jobs on CIRCE ==

Revision as of 22:01, 20 February 2017

Description

From the COMSOL Website: COMSOL Multiphysics® is a general-purpose software platform, based on advanced numerical methods, for modeling and simulating physics-based problems. With COMSOL Multiphysics, you will be able to account for coupled or multiphysics phenomena. With more than 30 add-on products to choose from, you can further expand the simulation platform with dedicated physics interfaces and tools for electrical, mechanical, fluid flow, and chemical applications. Additional interfacing products connect your COMSOL Multiphysics simulations with technical computing, CAD, and ECAD software.

Version

  • 5.2a

Authorized Users

  • CIRCE account holders
  • RRA account holders
  • SC account holders

Platforms

  • CIRCE cluster
  • RRA cluster
  • SC cluster
  • Workstation/PC, Cluster

Modules

COMSOL requires the following module file to run:

  • apps/comsol/5.2a

Available COMSOL Modules

  • AC/DC Module
  • CFD Module
  • Chemical Reaction Engineering Module
  • Heat Transfer Module
  • MEMS Module
  • Microfluidics Module
  • Nonlinear Structural Materials Module
  • Particle Tracing Module
  • RF Module
  • Structural Mechanics Module
  • Subsurface Flow Module
  • CAD Import Module
  • ECAD Import Module
  • LiveLink for MATLAB

Running Comsol Jobs on CIRCE

Tasks Shorter than 30 Minutes

Before you login to CIRCE, you need to make sure you have X11 Forwarding enabled. If you're logging in from a UNIX/Linux system, you will need to do the following:

[user@login0 ~]$ ssh -Y user@circe.rc.usf.edu

Once connected to CIRCE, you can open COMSOL using the steps below:

[user@login0 ~]$ module add apps/comsol/5.2a
[user@login0 ~]$ comsol

Alternatively, for Windows, Mac, and Linux users, COMSOL can also be launched through a remote desktop connection, then opening a terminal, loading the appropriate module file, and typing comsol. For more information about the CIRCE Desktop Environment, please see our CIRCE Desktop Environment documentation.

Tasks Longer than 30 Minutes

For computational tasks that will run longer than 30 minutes, you will need to start an interactive SRUN session by running the command below with example resources:

[user@login0 ~]$ srun --time=02:00:00 --nodes=1 --ntasks-per-node=8 --pty /bin/bash

This will request an interactive session on a compute node, with 8 processor cores, for a duration of 2 hours.

Comsol Batch Jobs from the Command Line

The COMSOL user guide is essential to understanding the application and making the most of it. The guide and this page should help you to get started with your simulations. Please refer to the Documentation section for a link to the guide.

  • Note on CIRCE: Make sure to run your jobs from your $WORK directory!
  • Note: Scripts are provided as examples only. Your SLURM executables, tools, and options may vary from the example below. For help on submitting jobs to the queue, see our SLURM User’s Guide.

Running Comsol on CIRCE is quite trivial. When you are ready to run the solver against your model, save the model and copy the ‘.mph’ file to CIRCE via which ever method you prefer and run:

sbatch --job-name=mymodel.mph runcomsol.sh

You will need to add the following information in a script file and reference it in the sbatch command argument:

#!/bin/bash
#
#SBATCH --time=04:00:00
#SBATCH --mem-per-cpu=2048
#SBATCH --ntasks=8

#### SLURM 8 processor COMSOL test to run for 4 hours.

module purge
module add apps/comsol/5.2a

# Change the below path to an actual temporary directory!
# To create one on the fly on local node storage, use:
# export TMPDIR=$(mktemp -d)
export TMPDIR="/path/to/temp/dir"

comsol -clustersimple batch -inputfile ${SLURM_JOB_NAME} \
       -outputfile ${SLURM_JOB_NAME//\.mph/}.out.mph \
       -batchlog ${SLURM_JOB_NAME}.${SLURM_JOB_ID}.comsol_log \
       -tmpdir $TMPDIR


For non-distributed, SMP jobs, the following script will work:

#!/bin/bash
#
#SBATCH --time=24:00:00
#SBATCH --mem=16384
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=12

#### SLURM 12 processor COMSOL test to run for 24 hours.

module purge
module add apps/comsol/5.2a

# Change the below path to an actual temporary directory!
# To create one on the fly on local node storage, use:
# export TMPDIR=$(mktemp -d)
export TMPDIR="/path/to/temp/dir"

comsol batch -np ${SLURM_NTASKS} -inputfile ${SLURM_JOB_NAME} \
        -outputfile ${SLURM_JOB_NAME}.${SLURM_JOB_ID} \
        -batchlog ${SLURM_JOB_NAME}.${SLURM_JOB_ID}.comsol_log \
        -tmpdir $TMPDIR


Solution data will be stored within the ‘.mph’ file and can be viewed on your local machine simply by copying the file back once you are done. A preferred way to deal with this is to use your home directory share to map your CIRCE home directory as a network drive. Then, you can simply save the file to the network drive, move it to your /work directory, and run the simulation on CIRCE. When the simulation is complete, copy the file back to your home on CIRCE, and re-open the file to review the results on your desktop.

Documentation

Home Page, User Guides, and Manuals

Benchmarks, Known Tests, Examples, Tutorials, and Other Resources

More Job Information

See the following for more detailed job submission information:

Reporting Bugs

Report bugs with COMSOL to the IT Help Desk: rc-help@usf.edu