Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Copy the .mph-file to your HOME or WORK directory (depending on where you want to run your simulation)
  • Create a SLURM script, e.g. using vi, emacs, ... any ASCII editor available

    Code Block
    languagebash
    themeEclipse
    titleSimple SLURM Batch Script (comsol_job.sh)
    collapsetrue
    #!/bin/bash 
    #SBATCH -o <your job-output path>/job.mpp2_Comsol.out
    #SBATCH -D <your work path>/
    #SBATCH -J mpp2_comsol_test
    #SBATCH --get-user-env 
    #SBATCH --clusters=mpp2
    #SBATCH --nodes=4
    #SBATCH --ntasks-per-node=4
    #SBATCH --mail-type=none
    #SBATCH --mail-user=<your email>
    #SBATCH --time=00:30:00
    . /etc/profile
    . /etc/profile.d/modules.shmodule load slurm_setup
    module load comsol
    mpiexec hostname | sort > mpi_hostfile
    export I_MPI_FABRICS=shm:ofa
    export OMP_NUM_THREADS=7
    comsol batch -inputfile micromixer_cluster.mph -outputfile output.mph -f mpi_hostfile -tmpdir $TMPDIR

    Take care to estimate the length of your job conservatively! Simple scaling tests on a smaller case can be of help! Select the NTASKS-PER-NODE and OMP_NUM_THREADS according to the architecture you are running Comsol on! Hint: NTASKS-PER-NODE * OMP_NUM_THREADS should be equal the total number of CPU cores per node!

  • Submit the job!

    Code Block
    languagebash
    $ sbatch comsol_job.sh


  • Using the SLURM tools (and also the --mail-type tag), you can get updates about the status of your job

...