Comsol BATCH licenses
Contents
Introduction
For each Comsol license (including the additional modules) there exists a corresponding BATCH license:
COMSOL COMSOLBATCH
RAYOPTICS RAYOPTICSBATCH
RF RFBATCH
These secondary BATCH licenses are mostly available (compared to the primary licenses that are heavily in use). It takes a little bit of preparation and additional effort to use them, but on the other hand, this doubles the amount of Comsol licenses that are available to ETH researchers.
Using the additional Comsol BATCH licenses
To use the Comsol BATCH licenses, there need to be 1 COMSOL and 1 COMSOLGUI license available (and if your model is using additional licenses like RF, then you also need to have 1 RF license available).
Preparation
Please follow the steps indicated here for preparing the use of Comsol BATCH licenses. The preparation only needs to be done once. Please note that in the following instructions ${USER} needs to be replaced with your ETH account name.
- ssh -Y ${USER}@euler.ethz.ch
- mkdir $HOME/comsol
- cd $HOME/comsol
- echo "127.0.0.1" > hostfile
- module load new comsol/5.5
- comsol
- click on Options->preferences in the menu bar
- click on Multicore and Cluster Computing in the navigation bar in the left part of the window
- make sure Cluster type (in newer Comsol versions, it is scheduler type) is set to General
- you can ignore the field Number of processors as COMSOL will ignore this number when running the COMSOLBATCH jobs.
- specify /cluster/home/${USER}/comsol/hostfile in the field Host file
- specify a directory in the field Batch directory, where comsol will store the initial .mph file and the result of the calculations
- make sure that the field External COMSOL installation directory path: contains the string /cluster/apps/comsol/5.5/x86_64 and that the checkbox is set.
- specify the bsub command (only the resource part), without the actual command to run, in the field Prepend command (Example: bsub -n 4 -W 36:00 -R rusage[mem=2048])
- click OK
- restart the COMSOL GUI to activate the changes in the preferences
Running a job
- open the COMSOL GUI
- open the simulation, you would like to run
- right-click on Study1 and choose Cluster computing. If the entry in the menu is not there, then you first have to click on the Show option in the model builder toolbar (a small eye icon) and choose the advanced study options entry from the menu
- specify a filename in the field Filename (Comsol will take the initial .mph input file, add some more information and save it under the new file name and at the location that you specify in the field Directory). Once the job has been submitted, it will be independent of the initial .mph file and only use the new one created for this job.
- set the value in the field Number of nodes to the number of CPU's you would like to use in the simulation (beware that this needs to match the number that was specified via bsub in the preparation part where the preferences are changed).
- this is the most important step: enable the checkbox Use batch license
- click on Study1 in the Model builder menu and then click the Compute button to start the calculation.
Now the job is submitted, but it is bound to the GUI (and when having a GUI open, you have a COMSOL and a COMSOLGUI license checked out, i.e., we do not gain anything if you use a COMSOL license per COMSOLBATCH license that you use). At this stage we are using the following licenses:
Number of jobs: 1 Licenses: 1 COMSOL 1 COMSOLGUI 1 COMSOLBATCH
The key step is now to detach the job from the GUI. As soon as the job started, there is a tab External process in the Messages window at the bottom right of the COMSOL GUI. At the bottom right of the tab, there is a button detach job which you need to click to detach the job from the GUI.
Now you can either close the GUI (which will give back the COMSOL and the COMSOLGUI license) or you can load the next .mph file to start the next COMSOL job. If you go for the second option, you would repeat the steps from the Running a job paragraph.
After having submitted the second job, the following licenses are in use:
Number of jobs: 2 1 COMSOL 1 COMSOLGUI 2 COMSOLBATCH
But when you then close the GUI, the COMSOL and COMSOLGUI license are given back. This means that in order to submit jobs that use the COMSOLBATCH licenses you have to check out one COMSOL and COMSOLGUI license, while you have the GUI open. But then you can submit as many jobs using only a COMSOLBATCH license as you want. And in the moment you close the GUI, the initially used COMSOL and COMSOLGUI license are given back.