NWChem installations at NSC

Level of support

Tier 2 NSC has only limited experience with this software, but we will try to help as much as possible. We have ran some tests, for example, if the program comes with a test suite, but they may be far from exhaustive. We will try to install and test new versions, as soon as we can.

Please see the page describing our software support categories for more information.
You can also contact support@nsc.liu.se for further information.

NWChem is a quantum chemical software which aims to provide computational chemistry tools that are scalable both in their ability to treat large scientific computational chemistry problems efficiently, and in their use of available parallel computing resources from high-performance parallel supercomputers to conventional workstation clusters.

NWChem software can handle

  • Biomolecules, nanostructures, and solid-state
  • From quantum to classical, and all combinations
  • Gaussian basis functions or plane-waves
  • Scaling from one to thousands of processors
  • Properties and relativity

NWChem is highly parallelized code with a strong focus on scalability. The NWChem installations at NSC are generally done by Johan Raber (raber@nsc.liu.se).

How to run

Provided you have a valid NWChem input file here is how you can run it from an interactive session:

@triolith: $ interactive -N2 --exclusive -t 00:30:00 #This drops you in a shell on an allocated node 
@node: $ module load nwchem/6.1.1
@node: $ nwchem.run input.nw > output.nwout

Running it in batch mode is very similar and an example is available below. Please remember to set the SCRATCH_DIR and possible PERMANENT_DIR to appropriate values in your input file. Setting the scratch directory is by far the most important. The permanent directory is set to the launch directory by default so it is far less important to set it usually.

It may be good to automate the setting of the scratch and permanent directories using tags in you input file like:


This tag can then be automatically set to an appropriate value on the command line of an interactive session or in a batch script like

sed -i "s:<<++SCRDIR++>>:$SNIC_TMP:" input.nw # Note: Double quotes are crucial here
sed -i "s:<<++PERMDIR++>>:$PWD:" input.nw # Note: Double quotes are crucial here.
                                          # It is assumed that submit dir is workdir for the job here

You are of course free to use a different tag name than this. For usage in a batch script, see below.

Example batch script

A minimal batch script for running NWChem at NSC looks like this:

#SBATCH -t 4:00:00
#SBATCH -J jobname
#SBATCH --exclusive
#SBATCH -A SNIC-xxx-yy

module load nwchem/6.1.1

sed -i "s:<<++SCRDIR++>>:$SNIC_TMP:" input.nw
sed -i "s:<<++PERMDIR++>>:$PWD:" input.nw

nwchem.run input.nw > output.nwout

exit $exit_status

(Note that you should edit the jobname and the account number before submitting.)

In this script NWChem will be run from the submit directory.

Running classical MD and QM/MM with NWChem

When loading a module file for NWChem, only the QM part is fully initialised and functional as not every setting for NWChem can be handled via environment variables. If you want to access the available forcefields for classical molecular dynamics or hybrid QM/MM runs, you will need to add a link in your home directory to a file in the NWChem installation tree like

ln -s /software/apps/nwchem/6.1.1/data/default.nwchemrc ~/.nwchemrc

Please adjust the above path to match the version of NWChem you are running.

Visualizing output from NWChem

Viewing the output from NWChem can be done with the GUIs Avogadro or Gabedit available via the module system. Should you wish to produce ray-traced images and movies from these interfaces you will also need to load a povray module. You will additionally need to run with X forwarding or the VNC solution currently installed. NSC recommends the VNC solution.

Known problems

  • When running the full QA test suite for version 6.1.1, a few round-off errors were detected for a handful of tests (out of 200+ in total). You will need to judge the suitability of this build yourself, for instance by comparing to old and known data.