Comsol files in the home directory

From ScientificComputing
Revision as of 11:17, 7 September 2023 by Nmarounina (talk | contribs) (Removing LSF syntax)

Jump to: navigation, search

Temp directory

COMSOL stores temporary data in /tmp which should not be used on the cluster. There is an option to specify a different path and this should be set to $TMPDIR, which is created by the batch system for each job. If $TMPDIR is used, some scratch space needs to be reserved for the job ( --tmp=YYY ). Please find here an example for the usage of $TMPDIR

sbatch -n 4 --time=36:00:00 --mem-per-cpu=2048 --tmp=20000 --wrap="comsol batch -tmpdir \$TMPDIR -clustersimple -inputfile infile.mph -outputfile outfile.mph"

Note: There are quotes around the entire COMSOL command and the $ needs to be masked with a \.

Configuration directory

COMSOL stores configuration information in the directory configuration that is located in $HOME/.comsol. It creates a huge number of directories for each COMSOL job, which can at some point create a problem with the file/directory quota of 100'000 for home directories. It is possible to change the location where the configuration files are saved with the command line option -configuration. Please find below an example where these files are written to $TMPDIR.

sbatch -n 4 --time=36:00:00 --mem-per-cpu=2048 --tmp=20000 --wrap="comsol batch -configuration \$TMPDIR/configuration/ -clustersimple -inputfile infile.mph -outputfile outfile.mph"

Workspace directory

When a COMSOL job is running, it saves temporary files to the workspace directory located in $HOME/.comsol. This can be avoided by redirecting these file to $TMPDIR for instance. Please find below an example

sbatch -n 4 --time=36:00:00 --mem-per-cpu=2048 --tmp=20000 --wrap="comsol batch -data \$TMPDIR/data/ -clustersimple -inputfile infile.mph -outputfile

Recovery directory

COMSOL saves recovery files in a hidden directory $HOME/.comsol/recovery. Because your home directory is subject to a quota, we recommend to either change the location where the recovery files are saved, or to entirely disable this feature. The options for the recovery files can either be changed in the COMSOL preferences window (permanent) or on the command line, when submitting a job (only for this particular job).

Comsol files preferences.png

In order to permanently disable the recovery feature, uncheck the check box Save recovery file in the COMSOL preferences window. If you would like disable the recovery option just for a particular job, then please add the -autosave off option to your COMSOL command:

sbatch -n 4 --time=36:00:00 --mem-per-cpu=2048 --tmp=20000 --wrap="comsol batch -autosave off -clustersimple -inputfile infile.mph -outputfile outfile.mph"

If the recovery files should be stored temporarily, then saving them in your personal scratch directory would be an option:

sbatch -n 4 --time=36:00:00 --mem-per-cpu=2048 --tmp=20000 --wrap="comsol batch -recoverydir /cluster/scratch/\$USER -clustersimple -inputfile infile.mph -outputfile outfile.mph"

Redirecting almost all files from $HOME/.comsol to $TMPDIR

We strongly recommend to redirect all files and directories from $HOME/.comsol to a different location (e.g.,$TMPDIR). The COMSOL part of the command should in this case look like (replacing -recoverydir with -prefsdir):

"comsol batch -clustersimple -tmpdir \$TMPDIR -configuration \$TMPDIR/configuration/ -data \$TMPDIR/data/ -prefsdir \$TMPDIR/preferences/ -inputfile infile.mph -outputfile outfile.mph"