M3: MRChem on HPC cluster#
Compute NMR Shielding Constants and Magnetizibility for a Transition Metal Complex#
Below you will find links to all all the relevant pages of the MRChem documentation. Please refer to these if you need more details on how to set up the calculations.
Introduction#
In this exercise you will use the MRChem code to compute NMR shielding constants and magnetizibilities for a Ni(CO)_3 complex bound to an N-Heterocyclic Carbene (NHC) ligand. NHCs are commonly used in organometallic chemistry, and are often involved in catalytic cycles. They contain a zero-valent carbon atom that acts as a very strong sigma-donor, which often coordinates to a transition metal. Due to the bulky nature of many NHCs, they are used to help stabilize reactive or exotic chemical species.
The NHC used here is depicted in the image below. One usually tunes the NHC by substituing the methyl groups with larger and more bulky side groups.
# 3D viewer for the water molecule
import py3Dmol
view = py3Dmol.view(width=200, height=200)
view.addModel(open('geometries/Ni_NHC.xyz').read())
view.setStyle({'stick': {}})
view.zoomTo()
view.show()
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
How to run the calculation#
Due to the size of the system, we need to run this calculation on one of the national HPC clusters. The instructions here are specific to Saga
.
We need a submit script where we set up the calculation, since we are submitting to the SLURM
queueing manager. We will be using MRChem in a hybrid OpenMP+MPI parallelization mode, which ensures very good scaling on HPC clusters.
We provide a convenience script that you can copy to the cluster (runMRChem.sh
), to use for setting up the SLURM variables, loading MRChem, and copying files to/from the scratch directory.
Here is the usage:
Usage: ./runMRChem.sh [ -h ] [ -i JOBNAME ] [ -t NTASKS ] [ -c NCPUS ] [ -T TIMELIMIT ] [ -m MEMORY ] [ -x ]
Optional arguments:
-h : Show this message and exit 0
-i <JOBNAME> : Input file w.o. extension (.inp assumed) default: jobname
-t <NTASKS> : Number of MPI processes default: 8
-c <NCPUS> : Number of OMP threads default: 8
-T <TIMELIMIT> : Wall time limit in SLURM format default: 10:00:00
-m <MEMORY> : Total memory in GB default: 60
-x : Submit job to queue default: false
Note: You may have to make the script executable:
user@saga:~$ chmod +x runMRChem.sh
The file runMRChem.sh
generates a job file jobname.job
like this (using default values):
#!/bin/bash
#SBATCH --account=nn4654k
#SBATCH --mail-type=None
#SBATCH --job-name=jobname
#SBATCH --output=jobname.log
#SBATCH --error=jobname.err
#SBATCH --time=10:00:00
#SBATCH --mem=60GB
#SBATCH --ntasks=8
#SBATCH --cpus-per-task=8
module purge
module load MRChem/toolchain-version
cp jobname.inp
cd
export OMP_NUM_THREADS=8
mrchem --launcher 'srun -n 8' jobname.inp
savefile jobname.out
savefile jobname.json
exit 0
which you can submit to the queue with this command
user@saga:~$ sbatch jobname.job
You can also let the script submit your job automatically by adding the -x
flag (but this only makes sense if you are running the script on the remote cluster).
If your jobfile already exists, you will be prompted to confirm the overwrite.
Example usage:
user@saga:~$ ./runMRChem.sh -i Ni_NHC -t 25 -T '30:00:00' -m 160GB -x
The MRChem input file#
Below is an outline of an MRChem input for an NMR properties calculation at the MW3 precision level. Try to use the documentation pages to find the relevant keywords for setting up the calculation. If you need additional help, don’t hesitate to ask :)
world_prec = 1.0e-3
world_unit = angstrom
Molecule {
$coords
...
$end
}
WaveFunction {
}
SCF {
}
Properties {
}
Response {
}
Computational details#
The GTO results were computed with the
PBE
functional, and so you should also usePBE
if the results are to comparable.An optimized geometry of the TM complex is supplied in
./geometries/Ni_NHC.xyz
.Use a KAIN SCF and response accelerator history of 15.
Make sure the SCF and response
max_iter
options are large enough (100 should be plenty).As starting guess,
sad_tz
at MW4 precision works well.
Note Input blocks are case sensitive, while keywords inside blocks are not