CHARMM Development Project
Posted By: shane yue Reading DCD trajectory using MPI CHARMM - 11/01/20 04:34 PM
Hi CHARMM users,

Hope all goes well.

I am trying to do some time-consuming analyses on our clusters using a CHARMM (c42b2) compiled with MPI.

When I read a DCD trajectory I got the fatal error:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CHARMM> ! Loop, calculate INTER
CHARMM> ! ---------------------------
CHARMM> set i = 1
Parameter: I <- "1"

CHARMM>

CHARMM> label loop

CHARMM> traj read ! read trajectory

READING TRAJECTORY FROM UNIT 11
NUMBER OF COORDINATE SETS IN FILE: 498
NUMBER OF PREVIOUS DYNAMICS STEPS: 1
FREQUENCY FOR SAVING COORDINATES: 1
NUMBER OF STEPS FOR CREATION RUN: 498

TITLE> Created by DCD plugin^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
TITLE> REMARKS Created 08 July, 2020 at 23:45^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
TITLE> * DATE: 11/ 1/20 9:56:40 CREATED BY USER: zhiyue
TITLE> *

***** LEVEL -5 WARNING FROM *****
***** READ errorno -1 for traj_0_0.dcd: 498 frames expected but 0 frames read
*******************************************************
BOMLEV ( 0) IS REACHED - TERMINATING. WRNLEV IS 5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The original DCD trajectory was generated by NAMD and processed with VMD PBCTools Plugin. But it was read successfully by a non-MPI CHARMM on the cluster. So I suspect the trajectory itself should be fine.

Thus, my questions are:

1) Can MPI CHARMM read DCD trajectory (with only one CPU requested)?
2) If yes, is there any special requirement (especially on CHARMM) to make it work?

Thanks in advance.

All the best
Posted By: lennart Re: Reading DCD trajectory using MPI CHARMM - 11/01/20 05:20 PM
A single-CPU CHARMM job should read and process a dynamics trajectory irrespective of how it was compiled. Most tracjectory processing in CHARMM does not work in parallel.
Posted By: rmv Re: Reading DCD trajectory using MPI CHARMM - 11/01/20 05:26 PM
It should work, but there may a number of variables influencing the behavior, such as the compiler suite and version, the MPI implementation and version, other actions being done in the CHARMM input file, and the incomplete implementation of the file format by the NAMD/VMD developers. (They don't properly use all of the data fields in the header record, and that has caused no end of problems in trying to read DCD files produced by other programs into CHARMM, esp. those mangled by the VMD tools.)

If you only wish to use a single core, you could try running the prog w/o using mpirun at startup. You probably need to do the MPI setup, though, due to runtime library dependencies.

Also, it could be a bug, so sometimes using a different CHARMM version can resolve these issues; c45b1 was released in August 2020.
Dr. Nilsson,

Thanks for your reply. I appreciate it.

Then I need to double check my Slurm sbatch script to make sure only a single CPU is requested.

Thanks again and stay safe while the pandemic is spiking again worldwide.

All the best
Rick,

Thanks for your further comments and instructions.

I tested the same scripts (CHARMM input & Slurm sbatch) using a trajectory generated by CHARMM and ran into the same fatal error. So I suspect it is more likely that the command 'traj read" does not work for MPI CHARMM.

One workaround is to replace 'traj read' with 'coor DYNA first XX nunit 1 begin @frame stop @frame skip ?SKIP'. And it worked.

I am not sure if CHARMM c45b1 could resolve the issue, but I will try.

Thanks again and stay safe.

All the best
Posted By: rmv Re: Reading DCD trajectory using MPI CHARMM - 11/01/20 08:45 PM
I recently used TRAJ READ in a loop, with a c43b1 MPI executable using 16 cores so that I could do an ENERGY call, then a series of INTE commands to compute peptide:membrane interactions.
Rick,

I am glad to learn that 'TRAJ READ' does work with MPI CHARMM.

Then it should be the compilation problem, based on your first post in reply. Well, seems that things become tricky (for me) now. Is there any special compilation requirement for an MPI CHARMM to work like yours?

Thanks.
Posted By: lennart Re: Reading DCD trajectory using MPI CHARMM - 11/02/20 10:20 AM
Note that the coor dyna command computes the average structure over the number of frames processed. It will be very slow if you try to a read a large number of single frames from a long trajectory since it starts over reading the trajectory from the beginning at each invocation. You can use "coor read file ifile .... CONT" (io.info):
READ COOR FILE IFILE 10 UNIT 51
READ COOR FILE CONT IFILE 10 UNIT 51
will first read frame 10 and then frame 20 from unit 51.
Dr. Nilsson,

Thanks for your further comments on the command 'COOR DYNA'.

I had been briefed about the "average" feature of 'COOR DYNA' before I started trying this workaround. Since I only deal with a single frame at a time, I think it should be fine. I tested both 'COOR DYNA' and 'TRAJ READ' locally and compared the "INTEraction" outputs, which turned out to be the same. But please kindly correct me if I am wrong.

Also, I am glad to learn the faster way, i.e., "COOR READ file file ... CONT". I appreciate it.

Best
Posted By: lennart Re: Reading DCD trajectory using MPI CHARMM - 11/02/20 08:32 PM
Just to be clear : The averaging that COOR DYNA does is not just a feature - it is the explicitly stated purpose of the command, so although it is possible to use it to read single frames, that usage could be confusing to someone looking at the script.
Dr. Nilsson,

Thanks for further clarification.

Best
© CHARMM forums