Valdes-Tresanco-MS / gmx_MMPBSA

gmx_MMPBSA is a new tool based on AMBER's MMPBSA.py aiming to perform end-state free energy calculations with GROMACS files.
https://valdes-tresanco-ms.github.io/gmx_MMPBSA/
GNU General Public License v3.0
229 stars 67 forks source link

Impossible to run mpirun task #118

Closed haroldgrosjean closed 2 years ago

haroldgrosjean commented 2 years ago

Hello,

I have a pretty complex anaconda environment which enable me to process proteins and ligands, run a virtual screening, prepare structures for MD simulations. I would like to analyze the results (single trajectory protein-ligand mmgbsa with interaction entropy and decomposition analysis) of those simulations using gmx_MMPBSA within the same environment. I can install gmx_MMPBSA normally, do the tests but I cannot run it with mpirun.

I use gromacs 2020.3 loaded from my modules. When I do in the directory provided bellow the operations goes to completion and returns a final DELTA G binding = -18.6574 +/- 3.9206

gmx_MMPBSA -O -i ./MMPBSA.in -cs ./prod.tpr -ci ./mmpbsa_compound_0.ndx -cg 1 2 -ct ./md_fit.xtc -cr ./compound_0_reference.pdb -cp ./complex.top -lm ./MOL_bcc_gaff2.mol2 -o ./FINAL_RESULTS_MMPBSA.dat -do ./FINAL_DECOMP_MMPBSA.dat -nogui

However when I run:

mpirun --oversubscribe -np 20 gmx_MMPBSA MPI -O -i ./MMPBSA.in -cs ./prod.tpr -ci ./mmpbsa_compound_0.ndx -cg 1 2 -ct ./md_fit.xtc -cr ./compound_0_reference.pdb -cp ./complex.top -lm ./MOL_bcc_gaff2.mol2 -o ./FINAL_RESULTS_MMPBSA.dat -do ./FINAL_DECOMP_MMPBSA.dat -nogui

This error returned is:

Traceback (most recent call last):
  File "/anaconda3/envs/autochem2/bin/gmx_MMPBSA", line 8, in <module>
    sys.exit(gmxmmpbsa())
  File "anaconda3/envs/autochem2/lib/python3.7/site-packages/GMXMMPBSA/app.py", line 50, in gmxmmpbsa
    from mpi4py import MPI
ImportError: /anaconda3/envs/autochem2/lib/python3.7/site-packages/mpi4py/MPI.cpython-37m-x86_64-linux-gnu.so: undefined symbol: ompi_mpi_logic
--------------------------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
mpirun detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:

  Process name: [[36995,1],1]
  Exit code:    1

I am under the strong impression that this may be because of a clash with other package and/ or with py4mpi but I am unable to identify its source nor solve it. I've tried to rebuild the environment from scratch but without success.

You may find attached the files required for the calculation as well as the content of my conda environment in: mpi_mmgbsa_fail.tar.gz

Which version of Python: Python 3.7.7 Which operating system: Ubuntu 18.04.6 LTS (Bionic Beaver)

I would be very grateful if you could indicate me a way to solve this problem.

Many thanks in advance for your assistance and best regards,

Harold Grosjean

Valdes-Tresanco-MS commented 2 years ago

Based on the reviews I have done, it appears that this is an incompatibility between the mpi4py and the MPI you are using. I also notice that you are using an envs (autochem2) which could be problematic in terms of the versions of the packages you use. My recommendation is that you do a fresh install of miniconda3.9 or create a new envs with a new python version and install gmx_MMPBSA in the said environment (assuming you will install AmberTools from conda). To do this, follow the steps below:

If you want to keep using the current conda, then create a new envs:

To be sure that its installation, activation and operation is correct, check that all executables are in their respective conda environments. which python # /home/mario/programs/miniconda/envs/test/bin/python which mpirun # /home/mario/programs/miniconda/envs/test/bin/mpirun which gmx_MMPBSA # /home/mario/programs/miniconda/envs/test/bin/gmx_MMPBSA

haroldgrosjean commented 2 years ago

Hello,

Many thanks for responding so quickly. Could the new environment contain the packages listed in the requirement file? Would it be possible to use another mpi library or a different version to run gmx_mmpbsa? As explained above, the whole codes needs all the packages listed.

Many thanks,

Harold

Valdes-Tresanco-MS commented 2 years ago

Precisely, creating a new env makes it easier to isolate installed packages. In this case, when you create a new env, the current one (autochem2) will continue to work as-is, while the new one (mmpbsa) will only have the necessary packages for gmx_MMPBSA to work properly. To switch between one environment and another you only have to use the commands conda activate autochem2 or conda activate mmpbsa. In summary, given the fact that there is an incompatibility between some of your packages, it is best to use an individual conda environment for each one. DO NOT install all packages on both, as it is not needed. I noticed in the requirements file it does not appear mpi4py, so I assume that you are using the system one, which according to the mpi4py developer is broken (incompatible with the actual version of mpi4py). Following the steps I give you should work properly. Sincerely Mario S

haroldgrosjean commented 2 years ago

Hi Mario,

Many thanks for your response. I managed to install the above successfully. I however had to install openmpi at the same time as py4mpi in the following fashion conda install -c conda-forge mpi4py openmpi. In addition, I also managed to add MDAnalysis to my environment as this package was required in my pipeline.

Thanks again for your help. Your tool is great and I am very much looking forward to the upgrade where explicit solvent molecules will be included.

Bests,

Harold

Valdes-Tresanco-MS commented 2 years ago

Excellent. The inclusion of explicit water molecules is probably version 1.6.0, as the current development version focuses on improving current functionalities and fixing bugs. Since it has taken a while, the amount of changes is considerable and we do not have much time, we are only focused on releasing this version as soon as possible. We are making a great effort to implement new features, which we hope will help our users. We always announce the new versions in the Facebook groups, our project in ReseachGate and if time allows us, we will do it on Youtube as well. In the same way, you can keep up to date if you follow the project Sincerely Mario S.