how to compile MPI and CUDA.

Hi all
I want to compile a program written in mpi and cuda but I have no idea how to compile them. I am using lammpi and my CUDA sdk is located at
/home/nishantha/prj/NVIDIA_CUDA_SDK directory.I want to compile the simpleCUBLAS example with with some MPI code embedded to it. Please somebody give me some help ?


You won’t be able to compile with MPI using the standard SDK makefile without modifying the considerably, and I guess if you are asking the question, it probably is a waste of time trying to understand the structure, because it is rather byzantine and not very easy to work with.

If you are only want to link an MPI program against CUBLAS, then the simplest thing to do is write a makefile for the MPI build, then just supply the path to the CUDA installation include directory during compilation (-I/your/cuda/path/include) and then give the linker the path to the CUDA libraries (-L/your/cuda/path/lib) and the necessary libraries for CUBLAS (-lcuda -lcudart -lcublas).

nvcc or any of the other fancier parts of the CUDA toolchain are not required if you are only using CUBLAS.