cpptraj icon indicating copy to clipboard operation
cpptraj copied to clipboard

How best to handle cpptraj vs. cpptraj.{MPI,OMP,cuda}

Open dacase opened this issue 11 months ago • 5 comments

The Amber24 Reference Manual describes MPI and OMP parallelization, but is not very clear about which executables do what. For example, if I configure (using the Makefile) with the -openmp flag, the executable that is created is called cpptraj.OMP. As far as I can see, the Reference Manual doesn't indicate that one needs to call cpptraj.OMP to get this behavior. And the AmberTools installation doesn't build cpptraj.OMP by default.

One idea, based on limited info: asking for -openmp or -cuda would still create an executable called cpptraj, but that had those capabilities. (Openmp could be turned off by setting OMP_NUM_THREADS.) There is probably still a need for cpptraj.MPI, since it has to be initiated via mpirun.

dacase avatar Dec 26 '24 20:12 dacase

As far as I can see, the Reference Manual doesn't indicate that one needs to call cpptraj.OMP to get this behavior.

This is definitely something that should be clarified in the manual.

One idea, based on limited info: asking for -openmp or -cuda would still create an executable called cpptraj, but that had those capabilities.

This can certainly be done. I originally used the .OMP etc suffixes to be consistent with how other programs in Amber differentiated their capabilities (e.g. pmemd for serial. pmemd.MPI for parallel, etc.).

If we did decide to just go with the "one executable to rule them all" route, I think the current CMAKE build process would need to be modified so that cpptraj isn't just constantly being written over.

drroe avatar Jan 02 '25 14:01 drroe

if cpptraj is also distributed via conda, it's hard to tell if cpptraj is compiled with what, so explicit extension seems clearer to me.

hainm avatar Jan 02 '25 15:01 hainm

it's hard to tell if cpptraj is compiled with what

cpptraj --defines can give you an inkling of what features cpptraj was compiled with; for example, if OpenMP support is present the -D_OPENMP flag will be present,. etc. The header at the beginning of execution also lets you know something about what executable you are running:

$ cpptraj.MPI.OMP

CPPTRAJ: Trajectory Analysis. V6.29.9 (GitHub) MPI OpenMP
    ___  ___  ___  ___
     | \/ | \/ | \/ | 
    _|_/\_|_/\_|_/\_|_

I wonder if the cpptraj distributed with conda should just be called cpptraj.conda? Maybe that's just compounding the original issue though.

drroe avatar Jan 02 '25 15:01 drroe

I wonder if the cpptraj distributed with conda should just be called cpptraj.conda?

So user has to change their script to specify either cpptraj or cpptraj.conda depending on if install via ambertools or cpptraj conda :D

hainm avatar Jan 02 '25 15:01 hainm

cpptraj --defines can give you an inkling of what features cpptraj was compiled with;

sounds good. I forgot about this.

hainm avatar Jan 02 '25 15:01 hainm