module load gromacs/version
The default version is the well scaling 4 version. The new code automatically exploits the domain decomposition algorithm, separate PME nodes and dynamic load balancing even without explicit flags to mdrun_mpi. If you want to specify them manually, you can use -dd and -npme flags. A starting point would be to use roughly 1/3 of the cores for pme only, but test different division as this can have a huge impact on performance! Usually it is best to leave the division of cores between dd and pme to mdrun. The log file now also suggests better values. Note also that with the new version you don't need to specify the number of processors for grompp.
Batch jobs
To run jobs in the compute nodes, use a script of the following
type (you can also load the module before submitting the job and then
omit it from the script):
#!/bin/csh
#BSUB -n 8
#BSUB -W 1:00
#BSUB -oo bsub.out
module load gromacs/4.5.4
mpirun -srun mdrun_mpi -s topol.tpr -n index.ndx
The script requests 8 cores and (only) 1 hour of running time. If you don't want to use module, you can add the full path to the mdrun_mpi yourself. For serial jobs you don't need the "mpirun -srun" part above, but you need the batch job script (run in the queue, not on the login node) see below.
All parallel computations must be done through the queuing system and in the compute nodes. Small interactive jobs can be run e.g. with a command like
bsub -n4 -I -W 4:00 mpirun -srun mdrun_mpi -s topol.tpr -n index.ndx
You can use the same way to run long analysis jobs or initial geometry optimizations. You can also request an x-terminal on a computing node (you will need linux, mac or an x-emulator on your windows-computer):
bsub -I xterm
or if you don't have an x-terminal:
bsub -Ip /bin/tcsh -i
Serial batch job
The serial version 4 and later of Gromacs automatically detects the number of cores in your machine and uses them all in a serial run by default. If you want to run a true serial job, you need to specify -nt 1 for mdrun:
#!/bin/cshSubmit the job by bsub < script_file
#BSUB -n 1
#BSUB -W 1:00
#BSUB -oo bsub.out
module load gromacs/4.5.4
mdrun_mpi -nt 1 -s topol.tpr -n index.ndx
Array jobs
If you have many separate jobs like in thermodynamic integration, it is easiest to run them as an array job. It is convenient to put the individual jobs in subdirectories named 1,2,...N. From where they can be run simply with mdrun. Below, there's an example script that will run Gromacs jobs from subdirectories 1,2,...97, so that at any given moment there's a maximum of 42 jobs running simultaneously.
#!/bin/csh
#BSUB -n 1
#BSUB -o array.out
#BSUB -e array.err
#BSUB -W 00:30
#BSUB -J "myarray[1-97:1]%42"
module load gromacs
#the next line is executed for each directory, i.e. $LSB_JOBINDEX
cd $WRKDIR/pathto/myjob/$LSB_JOBINDEX
# this runs the job in the $LSB_JOBINDEX'th directory
mdrun
# this could be used to run each job in parallel, change also "-n 1" at the top
#mpirun -srun mdrun_mpi $SLURM_NPROCS
Additional details can be asked from Atte. A lot of useful information can be found also in the Gromacs home page www.gromacs.org and its mailing lists.
Back to CSC Gromacs page.