Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the recommended way of using OpenMPI compiler wrappers for CUDA applications? #12225

Open
gonzalobg opened this issue Jan 10, 2024 · 3 comments
Labels

Comments

@gonzalobg
Copy link

For C++ applications I use the mpicxx compiler wrapper, and I can select the C++ compiler using the OMPI_CXX environment variable.

What's the recommended way to compile CUDA applications with the OpenMPI compiler wrappers?

@janjust
Copy link
Contributor

janjust commented Jan 11, 2024

For mpi applications just the wrapper will do.

For building .cu object files and link with mpi.
Build the .cu objects and .c objects, and link them with the mpi wrapper.

Take a look at this

@gonzalobg
Copy link
Author

gonzalobg commented Jan 12, 2024

Thanks. This:

module load mpi cuda
mpicc -c main.c -o main.o
nvcc -c multiply.cu -o multiply.o
mpicc main.o multiply.o -lcudart

does not cover how to build a main.cu with the mpi wrapper.

That is, given a single GPU application in which all files, including main.cu, are .cu files, and a user wants to drop in some MPI calls here and there to turn it into a multi-GPU application, how does the user do that?

It would be nice to have this documented in the OpenMPI documentation.

Ideally it would be as easy as:

modue load mpi cuda
mpi___ -c main.cu -o main.o
mpi___ -c multiply.cu -o multiply.o
mpi___ main.o multiply.o

@janjust
Copy link
Contributor

janjust commented Jan 12, 2024

It would be nice to have this documented in the OpenMPI documentation.

Agreed, should probably be documented better @Akshay-Venkatesh
@gonzalobg Thanks for the proposal, would you mind joining a dev call and pitch the proposal?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants