Compute Canada

Car-Parinello Molecular Dynamics (CPMD)

Please note: The FAQ pages at the HPCVL website are continuously being revised. Some pages might pertain to an older configuration of the system. Please let us know if you encounter problems or inaccuracies, and we will correct the entries.

This is an introduction to the usage of the Ab Initio Molecular Dynaics code "CPMD" on the HPCVL clusters. It is meant as an initial pointer to more detailed information, and to get started. It does not replace study of the manual.

What is CPMD?

The CPMD code is a parallelized plane wave/pseudopotential implementation of Density Functional Theory, particularly designed for ab-initio Molecular Dynamics simulation as described by Car and Parinello (R. Car and M. Parrinello, Phys. Rev. Lett. 55, 2471 (1985)) and is distributed free of charge to non-profit organizations. CPMD runs on many different computer architectures and it is well parallelized.

CPMD performs many Quantum-Chemical and Molecular-Dynamics calculations, including:

  1. Wavefunction optimization: direct minimization and diagonalization
  2. Geometry optimization: local optimization and simulated annealing
  3. Molecular dynamics: NVE, NVT, NPT ensembles.
  4. Path integral MD, free-energy path-sampling methods
  5. Response functions and many electronic structure properties
  6. Time-dependent DFT (excitations, molecular dynamics in excited states)
  7. LDA, LSD and many popular gradient correction schemes
  8. Isolated systems and system with periodic boundary conditions; k-points
  9. Hybrid quantum mechanical / molecular mechanics calculations (QM/MM)
  10. Coarse-grained non-Markovian meta-dynamics
  11. Works with norm conserving or ultra-soft pseudopotentials

For a complete list of capabilities of CPMD, consult the CPMD online manual, or check an extensive database of related publication.

Where is the program located?

The program resides in /opt/cpmd and is called cpmd.x. You also find some test examples in this directory, which are useful to get an idea of the input format for the program. You are not allowed to copy the executable or any part of the distribution onto your local machine. However you can easily obtain the program yourself. See the CPMD download page. Note that you will need a valid password to download the code.

How do I set my account up for running CPMD?

Unlike other programs, no special setup is needed to run CPMD. However, it is a good idea to put the directory with the CPMD program into the path, i.e. set the PATHenvironment variable:

setenv PATH=/opt/cpmd/3.13/64bit:$PATH (for csh)
PATH=/opt/cpmd/3.13/64bit:$PATH; export PATH (for bash etc.)

This is for the 64 bit default version of the program. A version with 32 bit address space is not available. The program can also be set up using the usepackage utility, simply by typing

use cpmd

How do I run CPMD?

Before you can access the CPMD executables and run the program, you have to read the license agreement that exists between the CPMD Consortium and HPCVL. You also have to sign a statement that you have done so, and return it to us (see last section for more information).

To run CPMD, you need to specify the executable, an input file, and (optionally) an output file. Assuming that the CPMD home is in your path, all you need to do is type

cpmd_serial.x input_name >output_name 

where input_name is the name of the input file (file extension is recommended to be.inp). If no output file output_name is specified, then the output is sent to the terminal screen. The above command line is for the serial version of the program. For larger runs, it is recommentded to use the parallel version. Then the command line is:

mpirun -np n_procs cpmd_ct8.x input_name >output_name 

Here, n_procs stands for the number of processes to be used in the parallel run. Because CPMD uses the Messageg Passing Interface MPI for parallelism, a runtime environment called ClusterTools needs to be used to start the program, which is the reason for thempirun command. In this case, we are using Version 8 of ClusterTools, which is based on OpenMPI. If n_procs=1 a serial run will be performed.

Like most programs, CPMD requires an input (.inp) file that describes the system for which the calculation will be performed, specifies the level of calculation, and provides other necessary information. The format of the input is described in detail in the CPMD documentation and cannot be explained here.

In addition to the input file you may need other auxilliary files which can be obtained from the CPMD directory. In most cases, you will have provide pseudo-poptential fileswhich usually have the file extension .psp. A collection of these may be found in directories of the form /opt/cpmd/3.13/PP_*.

Once all input is prepared, you will have to make the decision how many processes you want to use. This involves a trade-off between availability of CPU's on our systems, and the efficiency of additional processes, i.e. scaling. We suggest you perform test calculations of the same type as your production calculation, rerun several times with a varying number of processors. Comparing the timings lets you determine the maximum number of processors that yield acceptable scaling for your production calculation.

CPMD, like all production software, has to be run via the Grid Engine, which is a load-balancing program that submits batch jobs to low-load processors on the cluster cluster. To learn more about this program, click here. A CPMD job must be submitted to the Grid Engine in the form of an execution script. The calculation is set up by editing the execution script.

In the template, just replace all entries enclosed in by the proper values. The lines starting with "#$ -o" and "#$ -e" define the standard output and standard error files, respectively. Note that all lines starting with "#$" are directives for the Grid Engine, and will be interpreted when the script is submitted to that program. The "#$ -V" and "#$ -cwd" instruct the executing shell of the script to inherit the environment of the calling shell (for instance the path), and set the starting directory to the current working directory, repsectively. You also need to specify the name of the input file just like in an interactive run. The input file and the necessary pseudo-potential files are supposed to reside in the same directory as the Grid Engine script. The number of processes is specified in the "#$ -pe" line, which instructs the Grid Engine to allocate the proper number of CPUs for your run. You do not have to specify it separately in the cpmdcommand line, because Grid Engine sets the environment variable $NSLOTS properly.

We assume your Grid Engine script is called cpmd.sh. The script is submitted to GridEngine by typing

qsub cpmd.csh

No further specification of the output is necessary, since this is done inside the script and handled by GridEngine.

Before you can access the CPMD executables and run the program, you have to read the license agreement that exists between the CPMD Consortium and HPCVL. You also have to sign a statement that you have done so, and return it to us (see last section for more information).

To run CPMD, you need to specify the executable, an input file, and (optionally) an output file. Assuming that the CPMD home is in your path, all you need to do is type

cpmd_serial.x input_name >output_name 

where input_name is the name of the input file (file extension is recommended to be.inp). If no output file output_name is specified, then the output is sent to the terminal screen. The above command line is for the serial version of the program. For larger runs, it is recommentded to use the parallel version. Then the command line is:

mpirun -np n_procs cpmd_ct8.x input_name >output_name 

Here, n_procs stands for the number of processes to be used in the parallel run. Because CPMD uses the Messageg Passing Interface MPI for parallelism, a runtime environment called ClusterTools needs to be used to start the program, which is the reason for thempirun command. In this case, we are using Version 8 of ClusterTools, which is based on OpenMPI. If n_procs=1 a serial run will be performed.

Like most programs, CPMD requires an input (.inp) file that describes the system for which the calculation will be performed, specifies the level of calculation, and provides other necessary information. The format of the input is described in detail in the CPMD documentation and cannot be explained here.

In addition to the input file you may need other auxilliary files which can be obtained from the CPMD directory. In most cases, you will have provide pseudo-poptential fileswhich usually have the file extension .psp. A collection of these may be found in directories of the form /opt/cpmd/3.13/PP_*.

Once all input is prepared, you will have to make the decision how many processes you want to use. This involves a trade-off between availability of CPU's on our systems, and the efficiency of additional processes, i.e. scaling. We suggest you perform test calculations of the same type as your production calculation, rerun several times with a varying number of processors. Comparing the timings lets you determine the maximum number of processors that yield acceptable scaling for your production calculation.

CPMD, like all production software, has to be run via the Grid Engine, which is a load-balancing program that submits batch jobs to low-load processors on the cluster cluster. To learn more about this program, click here. A CPMD job must be submitted to the Grid Engine in the form of an execution script. The calculation is set up by editing the execution script.

In the template, just replace all entries enclosed in {} by the proper values. The lines starting with "#$ -o" and "#$ -e" define the standard output and standard error files, respectively. Note that all lines starting with "#$" are directives for the Grid Engine, and will be interpreted when the script is submitted to that program. The "#$ -V" and "#$ -cwd" instruct the executing shell of the script to inherit the environment of the calling shell (for instance the path), and set the starting directory to the current working directory, repsectively. You also need to specify the name of the input file just like in an interactive run. The input file and the necessary pseudo-potential files are supposed to reside in the same directory as the Grid Engine script. The number of processes is specified in the "#$ -pe" line, which instructs the Grid Engine to allocate the proper number of CPUs for your run. You do not have to specify it separately in the cpmdcommand line, because Grid Engine sets the environment variable $NSLOTS properly.

We assume your Grid Engine script is called cpmd.sh. The script is submitted to GridEngine by typing

qsub cpmd.csh

No further specification of the output is necessary, since this is done inside the script and handled by GridEngine.

Where can I get further information?

CPMD is a rather sophisticated program, and requires careful study of the input format, and a certain degree of knowledge about the "nuts and bolts" of computational quantum chemistry and molecular dynamics. It is impossible to use the program efficiently without reading the user documentation, which can be downloaded here. There is an official CPMD homepage with information about the program, donloading a copy yourself, and the history of CPMD. There is also a mailing list.

HPCVL also provides support for the usage of programs that are installed on its clusters. You can get in touch with us via our contact page or by sending email to help@hpcvl.org

Are there licensing issues with CPMD?

In short, no. CPMD is distributed by the CPMD Consortium and jointly owned by IBM and the Max-Planck Institute for Solid-State Research in Stuttgart. Non-commercial institutions and individuals can obtain a free copy of the program. The CPMD Consortium requires that you register and that you do not redistribute the code. CPMD is a very portable program, and will run on many platforms.

However, like with all licensed software on HPCVL computers, we require our users to read the agreement that exists between the owners of Gamess and HPCVL. If you want to use Gamess, you will have to read through the following license agreement, and then sign a statement that you have read and understood the agreement and will abide by it as a user of our facilities. Please return it to us by fax or mail. You will then be included in a Unix group that allows you access to the program.