Packmol was originally developed by J. M. Martínez and L. Martínez at the State University of Campinas. It creates an initial point for molecular dynamics simulations by packing molecules in defined regions of space. The packing guarantees that short range repulsive interactions do not disrupt the simulations. It uses an optimization subroutine called GENCAN that is part of the TANGO project.
Here you will find information about how to compile and use the Parallel Packmol. For more information about Packmol and its usage please click here.
To download the latest version, follow this link.
To compile the source code we strongly recommend you to use the GNU Fortran Compiler gfortran version 4.2 because it already comes with an OpenMP implementation. Almost all the instructions given here will assume the use of Linux and gfortran 4.2.
- First extract the source files to a local directory.
- Then compile with:
gfortran-4.2 -fopenmp -O3 -o parpackmol *.f.
or just typemake
. - Just a small note here: If you are using Intel Fortran Compiler with OpenMP support you have to compile with
ifort -openmp -o parpackmol *.f
The only additional steps you may follow is set the number of CPUs wanted in the program execution and some scheduling options. You can do that by setting the following environmental variables (the following instructions about environmental variables are valid to any OpenMP program, independently of the compiler used):
-
OMP_NUM_THREADS
with the command:export OMP_NUM_THREADS=X
, whereX
is the number of desired CPUs.
Now you can run the Parallel Packmol as usual, for example:./packmol < input.inp
-
OMP_SCHEDULE
with the command:OMP_SCHEDULE="dynamic,100"
, wheredynamic,100
stands for a a dynamic scheduling with chuck size equals to 100 (system schedules 100 tasks units each time a process becomes idle into the parallel region). Other scheduling options can be found here.
Now you can run the Parallel Packmol as usual, for example:./parpackmol < input.inp