OK, I wrote my first MPI+CUDA program (attached). I took the simple CUDA example from the NVIDIA tutorial that adds two vectors on the GPU. I added MPI around it so that each process does its local computation and at the end rank 0 broadcasts a "Done" message to other processes, who print it out. They also do a barrier at the end. The vector addition is not distributed among the processes yet, but that can be easily done since MPI communication is working. I built MPICH2 with CC set to nvcc. Nothing special was needed. Even the Fortran interface and everything else got built as usual. Just compiled the program as mpicc vecadd.cu and ran as mpiexec -n 4 a.out. It works. My next step is to port the MPICH2 cpi example to CUDA, i.e., doing the local pi computation in CUDA. Rajeev
Cool! -- Rob On Jul 15, 2009, at 6:21 PM, Rajeev Thakur wrote:
OK, I wrote my first MPI+CUDA program (attached). I took the simple CUDA example from the NVIDIA tutorial that adds two vectors on the GPU. I added MPI around it so that each process does its local computation and at the end rank 0 broadcasts a "Done" message to other processes, who print it out. They also do a barrier at the end. The vector addition is not distributed among the processes yet, but that can be easily done since MPI communication is working.
I built MPICH2 with CC set to nvcc. Nothing special was needed. Even the Fortran interface and everything else got built as usual. Just compiled the program as mpicc vecadd.cu and ran as mpiexec -n 4 a.out. It works.
My next step is to port the MPICH2 cpi example to CUDA, i.e., doing the local pi computation in CUDA.
Rajeev <vecadd.cu>
participants (2)
-
Rajeev Thakur -
Rob Ross