User Tools

Site Tools


nwchem

NWChem

NWChem is a scalable computational tool for large scale molecular simulations. Along with computational chemistry the package also inculdes quantum chemical and molecular dynamics functionality. It was developed at the Pacific Northwest National Labratory. More documentation is avaliable at the NWChem main page.

Enviornment Setup

First add these modules to your .bashrc file to satisfy the dependencies for and load NWChem itself.

module load intel/12.1.5 
module load mvapich2/1.8 
module load mkl/12.1.5 
module load nwchem

Also two environmental variables are needed to adjust the behavior of MVAPICH2 library. Add these two lines to your $HOME/.bashrc file.

export MV2_ENABLE_AFFINITY=0
export IPATH_NO_CPUAFFINITY=1

Additionally, NWChem looks for a $HOME/.nwchemrc file which specifies the location of the basis library and force field parameters. To use the preconfigured default nchemrc file run:

razor-l1:jokinsey:~$ ln -s /share/apps/NWChem/nwchem-6.1.1/data/default.nwchemrc ~/.nwchemrc

This links the default nchemrc file to your $HOME directory so NWChem knows where to find the file

Example Job

Create a directory NWCHEM-JOBS to store the output from the example. A set of example input files is located in /share/apps/NWChem/nwchem-6.1.1/examples directory. We'll use the benzene.nw example. Copy the input file to your $HOME/NWHCEM-JOBS directory. This example uses a separate file to store geometry of the molecule benzene.pdb which also needs to be copied.

razor-l1:jokinsey:~$ mkdir NWCHEM-JOBS
razor-l1:jokinsey:~$ cp /share/apps/NWChem/nwchem-6.1.1/examples/md/benzene/benzene.* ~/NWCHEM-JOBS

Edit the benzene.nw file to specify the scratch directory.

start benzene

scratch_dir /scratch/YourUserNameHere

prepare
 system benzene_em
 new_top new_seq
 solvate
end

task prepare

md
 system benzene_em
 sd 100
end

task md optimize

task shell "cp benzene_em.qrs benzene_md.rst"

md
 system benzene_md
 data 100
 isotherm
 isobar
 print step 10 stat 100
end

task md dynamics

In the directory contianing the benzene.nw input file, create a PBS script and name it nwchem.pbs.

#!/bin/bash
#PBS -N nwchem
#PBS -q tiny12core
#PBS -j oe
#PBS -o nwchem.$PBS_JOBID
#PBS -l nodes=1:ppn=12
#PBS -l walltime=1:00:00

cd $PBS_O_WORKDIR
cp benzene.* /scratch/$PBS_JOBID
cd /scratch/$PBS_JOBID

NP=$(wc -l < $PBS_NODEFILE)

mpirun -np $NP -machinefile $PBS_NODEFILE nwchem benzene.nw > benzene.out
mv benzene* bnz*  $PBS_O_WORKDIR

This PBS script moves the test files to the /scratch/$PBS_JOBID directory where we will run the job then moves the output files back to the $PBS_O_WORKDIR where we submitted the job from.

Then submit the job to be run in the queue tiny12core which we specified in the PBS file.

razor-l1:jokinsey:~/NWCHEM-JOBS$ qsub nwchem.pbs

The job will produce several files . benzene.out as specified in the PBS input script will contain the most relevant output.

nwchem.txt · Last modified: 2017/10/12 17:49 by jokinsey