Comsol
COMSOL Multiphysics is a cross-platform finite element analysis, solver, and multiphysics simulation software suite.
License required
Please purchase, download, and install the Comsol license yourself. For assistance with installation or usage, contact us with proof of your research group's Comsol license.
1. Script Template
submit.sh
#!/bin/bash
#SBATCH --nodes=1 # Number of nodes
#SBATCH --ntasks-per-node=56 # Number of cores per node
#SBATCH --ntasks=56 # Total number of cores
#SBATCH --partition=g1_share # Queue partition; must specify the correct partition
#SBATCH --job-name=hello # Job name
#SBATCH --output=hello.%j.out # Normal log output (%j parameter value is jobId)
#SBATCH --error=hello.%j.err # Error log output (%j parameter value is jobId)
##############################################
# Software Envrironment #
##############################################
unset I_MPI_PMI_LIBRARY # Unset default MPI library, use Intel's built-in
export I_MPI_JOB_RESPECT_PROCESS_PLACEMENT=0 # Parameter modification required for Intel multi-node jobs
# module load intel/2022 intelmpi/2022 # Load Intel environment
##############################################
# Run job #
##############################################
comsol batch -inputfile applications/COMSOL_Multiphysics/Equation_Based/black_scholes_put.mph -outputfile my_test.mph
2. The meanings of the command-line parameters are as follows:
-comsol batch: Indicates using COMSOL for batch processing.-inputfile: Indicates the path and filename of the input file.-applications/COMSOL_Multiphysics/Equation_Based/black_scholes_put.mph: Indicates the path and filename of the input file; here, it is a COMSOL model file used to solve the Black-Scholes equation.-outputfile: Indicates the path and filename of the output file.-my_test.mph: Indicates the path and filename of the output file; here, the solution results are saved as a COMSOL model file named my_test.mph.
3. Slow COMSOL Performance
Since Comsol software has been supported, users have occasionally reported that it runs slower than on local machines.
After consulting with Comsol users, it was found that due to the software's own algorithms, running on multiple cores does not guarantee faster execution speeds.
Users are advised to optimize models locally by simplifying structures and couplings. Generally, the software library examples are the best references.