(in parts copied from https://scicomp.ethz.ch/wiki/Comsol_files_in_the_home_directory)

Temp directory

COMSOL stores temporary data in /tmp which is comparably small and should be avoided in particular on interactive nodes. Consider redirecting comsol temporary files for example to BeeGFS:

export TMPDIR=/beegfs/desy/user/$USER/.comsol
mkdir -p $TMPDIR
comsol batch -tmpdir $TMPDIR -clustersimple -inputfile infile.mph -outputfile outfile.mph

Make sure to clean up $TMPDIR regularly!

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. It is possible to change the location where the configuration files are saved with the command line option -configuration. For example

export TMPDIR=/beegfs/desy/user/$USER/.comsol
mkdir -p $TMPDIR
comsol batch -configuration $TMPDIR/configuration/comsol_@process.id -tmpdir $TMPDIR -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 example

export TMPDIR=/beegfs/desy/user/$USER/.comsol
mkdir -p $TMPDIR
comsol batch -data $TMPDIR/data/comsol_@process.id -configuration $TMPDIR/configuration/comsol_@process.id -tmpdir $TMPDIR -clustersimple -inputfile infile.mph -outputfile outfile.mph

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 by adding -autosave off, for example

export TMPDIR=/beegfs/desy/user/$USER/.comsol
mkdir -p $TMPDIR
comsol batch -autosave off -data $TMPDIR/data/comsol_@process.id -configuration $TMPDIR/configuration/comsol_@process.id -tmpdir $TMPDIR -clustersimple -inputfile infile.mph -outputfile outfile.mph

If the recovery files should be stored temporarily, then saving them in a custom location using -recoverydir $TMPDIR would be an option

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

In most cases it's advisable to redirect all files and directories from $HOME/.comsol to a different location (e.g.,$TMPDIR), for example

export TMPDIR=/beegfs/desy/user/$USER/.comsol
mkdir -p $TMPDIR
comsol batch -clustersimple -autosave off -data $TMPDIR/data/comsol_@process.id -configuration $TMPDIR/configuration/comsol_@process.id \
             -tmpdir $TMPDIR -prefsdir $TMPDIR/preferences/comsol_@process.id \
             -inputfile infile.mph -outputfile outfile.mph

Permanent change of directories

Some of the file locations can be permanently changed using COMSOL Preferences:

Attachments: