From 1e3719b0a2632dc9399d3969e5cb341169edd0f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Krup=C4=8D=C3=ADk?= <lukas.krupcik@vsb.cz> Date: Mon, 20 Sep 2021 10:58:52 +0200 Subject: [PATCH] Update comsol-multiphysics.md --- .../cae/comsol/comsol-multiphysics.md | 50 +++++++++---------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/docs.it4i/software/cae/comsol/comsol-multiphysics.md b/docs.it4i/software/cae/comsol/comsol-multiphysics.md index 38b7f0464..db2daadf8 100644 --- a/docs.it4i/software/cae/comsol/comsol-multiphysics.md +++ b/docs.it4i/software/cae/comsol/comsol-multiphysics.md @@ -20,7 +20,7 @@ On the clusters, COMSOL is available in the latest stable version. There are two * **Commercial** or so called **COM variant**, which can used also for commercial activities. **COM variant** has only subset of features compared to the **EDU variant** available. More about licensing [here][1]. -To load the `COMSOL` module, use: +To load the default `COMSOL` module ([**not** recommended][4]), use: ```console $ ml COMSOL @@ -40,7 +40,7 @@ To prepare COMSOL jobs in the interactive mode, we recommend using COMSOL on the Example for Barbora: ```console -$ qsub -I -X -A PROJECT_ID -q qprod -l select=1:ncpus=36 +$ qsub -I -X -A PROJECT_ID -q qprod -l select=1:ncpus=36:mpiprocs=36 $ ml av COMSOL ------------------------------ /apps/modules/phys ------------------------------ @@ -50,32 +50,31 @@ $ ml COMSOL/5.2.0-EDU $ comsol -3drend sw ``` -!!! info - If you receive errors at startup, for example, of the following type: +* If you receive errors at startup, for example, of the following type: - ```console +```console FL3D: error at line 814 in file fl3dglcontext_x11common.c: PBuffers are not supported by the system. FL3D: error at line 235 in file fl3dglcontext_x11common.c: assert: x11Handle - ``` +``` - you need to run COMSOL with additional parameters: +you need to run COMSOL with additional parameters: - ```console +```console $ comsol -3drend sw - ``` +``` To run COMSOL in batch mode without the COMSOL Desktop GUI environment, utilize the default (comsol.pbs) job script and execute it via the `qsub` command: ```bash #!/bin/bash -#PBS -l select=3:ppn=24 +#PBS -l select=3:ncpus=36:mpiprocs=36 #PBS -q qprod #PBS -N JOB_NAME #PBS -A PROJECT_ID -cd /scratch/work/user/$USER/ || exit +cd /scratch/project/PROJECT_ID/ || exit echo Time is `date` echo Directory is `pwd` @@ -85,12 +84,11 @@ echo '**PBS_NODEFILE***END*********' text_nodes < cat $PBS_NODEFILE -ml COMSOL -# ml COMSOL/51-EDU +ml COMSOL/5.2.0-EDU ntask=$(wc -l $PBS_NODEFILE) -comsol -nn ${ntask} batch -configuration /tmp –mpiarg –rmk –mpiarg pbs -tmpdir /scratch/.../$USER/ -inputfile name_input_f.mph -outputfile name_output_f.mph -batchlog name_log_f.log +comsol -3drend sw -nn ${ntask} batch -configuration /tmp –mpiarg –rmk –mpiarg pbs -tmpdir /scratch/project/PROJECT_ID/ -inputfile name_input_f.mph -outputfile name_output_f.mph -batchlog name_log_f.log ``` A working directory has to be created before sending the (comsol.pbs) job script into the queue. The input file (name_input_f.mph) has to be in the working directory or a full path to the input file has to be specified. The appropriate path to the temp directory of the job has to be set by the `-tmpdir` command option. @@ -102,11 +100,9 @@ COMSOL is a software package for the numerical solution of partial differential LiveLink for MATLAB is available in both **EDU** and **COM** **variant** of the COMSOL release. On the clusters there is 1 commercial (**COM**) and 5 educational (**EDU**) licenses of LiveLink for MATLAB (see the [ISV Licenses][3]). The following example shows how to start COMSOL model from MATLAB via LiveLink in the interactive mode. ```console -$ xhost + -$ qsub -I -X -A PROJECT_ID -q qexp -l select=1:ppn=24 -$ ml MATLAB -$ ml COMSOL -$ comsol server MATLAB +$ qsub -I -X -A PROJECT_ID -q qexp -l select=1:ncpus=36:mpiprocs=36 +$ ml MATLAB/R2015b COMSOL/5.2.0-EDU +$ comsol -3drend sw server MATLAB ``` On the first start of the LiveLink for MATLAB (client-MATLAB/server-COMSOL connection), the login and password is requested; this information is not requested again. @@ -115,12 +111,12 @@ To run LiveLink for MATLAB in batch mode with (comsol_matlab.pbs) job script, yo ```bash #!/bin/bash -#PBS -l select=3:ppn=24 +#PBS -l select=3:ncpus=36:mpiprocs=36 #PBS -q qprod #PBS -N JOB_NAME #PBS -A PROJECT_ID -cd /scratch/work/user/$USER || exit +cd /scratch/project/PROJECT_ID || exit echo Time is `date` echo Directory is `pwd` @@ -130,21 +126,21 @@ echo '**PBS_NODEFILE***END*********' text_nodes < cat $PBS_NODEFILE -ml MATLAB -ml COMSOL/51-EDU +ml MATLAB/R2015b COMSOL/5.2.0-EDU ntask=$(wc -l $PBS_NODEFILE) -comsol -nn ${ntask} server -configuration /tmp -mpiarg -rmk -mpiarg pbs -tmpdir /scratch/work/user/$USER/work & -cd /apps/cae/COMSOL/51/mli -matlab -nodesktop -nosplash -r "mphstart; addpath /scratch/work/user/$USER/work; test_job" +comsol -3drend sw -nn ${ntask} server -configuration /tmp -mpiarg -rmk -mpiarg pbs -tmpdir /scratch/project/PROJECT_ID & +cd $EBROOTCOMSOL/mli +matlab -nodesktop -nosplash -r "mphstart; addpath /scratch/project/PROJECT_ID; test_job" ``` -This example shows how to run LiveLink for MATLAB with the following configuration: 3 nodes and 16 cores per node. A working directory has to be created before submitting (comsol_matlab.pbs) job script into the queue. The input file (test_job.m) has to be in the working directory or a full path to the input file has to be specified. The Matlab command option (`-r ”mphstart”`) created a connection with a COMSOL server using the default port number. +This example shows how to run LiveLink for MATLAB with the following configuration: 3 nodes and 36 cores per node. A working directory has to be created before submitting (comsol_matlab.pbs) job script into the queue. The input file (test_job.m) has to be in the working directory or a full path to the input file has to be specified. The Matlab command option (`-r ”mphstart”`) created a connection with a COMSOL server using the default port number. [1]: licensing-and-available-versions.md [2]: ../../../general/accessing-the-clusters/graphical-user-interface/x-window-system.md [3]: ../../isv_licenses.md +[4]: ../modules/lmod/ [a]: http://www.comsol.com [b]: http://www.comsol.com/structural-mechanics-module -- GitLab