Re: [AMBER] cuda parallel - can't find mpi.h

From: Jason Swails <jason.swails.gmail.com>
Date: Fri, 1 Jun 2012 12:16:20 -0400

Do this:

mpif90 -show

You should get something like this (this is mine, yours will have gfortran
or something):

ifort -I/mpi/intel-12.1.3/mpich2-1.4.1p1/include
-I/mpi/intel-12.1.3/mpich2-1.4.1p1/include
-L/mpi/intel-12.1.3/mpich2-1.4.1p1/lib -lmpichf90 -lmpichf90 -lmpich -lopa
-lmpl -lrt -lpthread

The mpich2 includes are found in /mpi/intel-12.1.3/mpich2-1.4.1p1/include
(next to the -I [eye, not L]). You need this
(-I/mpi/intel-12.1.3/mpich2-1.4.1p1/include) on the PMEMD_CU_INCLUDES line.
 So my PMEMD_CU_INCLUDES line looks like this:

PMEMD_CU_INCLUDES=-I$(CUDA_HOME)/include -IB40C -IB40C/KernelCommon
-I/mpi/intel-12.1.3/mpich2-1.4.1p1/include

The reason this is an issue is because your MPI is not installed in the
"typical" way that Amber assumes. I had at one point modified the
configure script to pull the MPI include directory straight from the mpif90
-show output (which would have fixed this issue), but I didn't know if
mpif90 -show was universal to all MPIs, so I never added it to Amber 12.

HTH,
Jason

On Fri, Jun 1, 2012 at 11:45 AM, Jonathan Gough
<jonathan.d.gough.gmail.com>wrote:

> I did search for this answer, but it was not there exactly. What was there
> i tried and it didn't work.
>
> ubuntu 12.04
> amber 12
> openmpi
>
> in .bashrc
> export LD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PATH
> export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
> export AMBERHOME=/home/jonathan/amber12
> export PATH=$PATH:/usr/local/cuda/bin
> export CUDA_HOME=/usr/local/cuda
> export PATH=$PATH:/$CUDA_HOME/bin
>
>
> serial compile and test worked/passed
>
> parallel compile and test worked/passed
>
> cuda compile and test worked/passed (finally - thanks Ross, David case,
> Jason and others)
> (this uses the 'dac' method of editing of the config.h file moving
> ./cuda/cuda.a infront of the flags post configure, pre install)
>
> finally while trying to compile the paralllel cuda version, I get the
> following error.
>
> make[3]: Entering directory `/home/jonathan/amber12/src/pmemd/src'
> make -C ./cuda
> make[4]: Entering directory `/home/jonathan/amber12/src/pmemd/src/cuda'
> /usr/local/cuda/bin/nvcc -use_fast_math -O3 -gencode
> arch=compute_13,code=sm_13 -gencode arch=compute_20,code=sm_20 -DCUDA -DMPI
> -DMPICH_IGNORE_CXX_SEEK -I/usr/local/cuda/include -IB40C
> -IB40C/KernelCommon -I/usr/include -c kForcesUpdate.cu
> In file included from gpu.h:15:0,
> from kForcesUpdate.cu:14:
> gputypes.h:30:17: fatal error: mpi.h: No such file or directory
> compilation terminated.
> make[4]: *** [kForcesUpdate.o] Error 1
> make[4]: Leaving directory `/home/jonathan/amber12/src/pmemd/src/cuda'
> make[3]: *** [cuda/cuda.a] Error 2
> make[3]: Leaving directory `/home/jonathan/amber12/src/pmemd/src'
> make[2]: *** [cuda_parallel] Error 2
>
>
> Here are the path's that are in place using whereis
>
> mpi: /usr/include/mpi
>
> openmpi: /etc/openmpi /usr/lib/openmpi /usr/include/openmpi
> /usr/share/openmpi
>
> mpif90: /usr/bin/mpif90.openmpi /usr/bin/mpif90 /usr/bin/X11/mpif90.openmpi
> /usr/bin/X11/mpif90 /usr/share/man/man1/mpif90.1.gz
>
> the one it can't find is at:
> /usr/include/mpi/mpi.h
>
> Previously it was suggested to add MPI_HOME. to the path /usr and I did try
> that. no dice.
>
> (export MPI_HOME=/usr)
>
> -- also tried
>
> (export PATH=$PATH:/$MPI_HOME/usr/bin/mpif90)
>
> no dice
>
> tried it without the mentioned edit in the config.h file, no dice
> I did a full clean and recompiled parallel successfully and it passed all
> tests.
> parallel cuda compile (after that) still gives the same error.
>
> jason mentioned adding the path to the nvcc flags, which I understand in
> theory, but I'm not sure exactly of how the syntax is supposed to look. (if
> someone could show me that would be great =))
>
> any insight on fixing this would be appreciated!
>
> Thanks,
> Jonathan
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber
>



-- 
Jason M. Swails
Quantum Theory Project,
University of Florida
Ph.D. Candidate
352-392-4032
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Fri Jun 01 2012 - 09:30:03 PDT
Custom Search