Skip to content

Use CUDA-Aware MPI#6

Open
gzagaris wants to merge 3 commits intomainfrom
bugfix/use-cudaaware-mpi
Open

Use CUDA-Aware MPI#6
gzagaris wants to merge 3 commits intomainfrom
bugfix/use-cudaaware-mpi

Conversation

@gzagaris
Copy link
Copy Markdown
Collaborator

No description provided.

@gzagaris gzagaris self-assigned this Sep 19, 2021
src/LocalMesh.C Outdated
pc.postRecvs_direct(qbuf_d2,nfields_d,rcvmap,ireq,mycomm,&reqcount);

// wait for pack kernel to finish packing buffers?
FVSAND::gpu::synchronize();
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I think we need to synchronize here since the pack kernel, updateHost in line 336 may have not finished packing the send buffers in qbuf_d

inline
void postRecvs_direct(double *qbuf, int nfields,
std::map <int, std::vector<int>> rcvmap,
const std::map <int, std::vector<int>>& rcvmap,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This avoids deep copies when passing the maps to this function.

inline
void postSends_direct(double *qbuf, int nfields,
std::map <int, std::vector<int>> sndmap,
const std::map <int, std::vector<int>>& sndmap,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

@gzagaris gzagaris force-pushed the bugfix/use-cudaaware-mpi branch 6 times, most recently from f380460 to d0c425e Compare September 26, 2021 20:14
@jsitaraman
Copy link
Copy Markdown
Owner

These all look ok to me. Go ahead and merge if you feel comfortable with it

@gzagaris gzagaris force-pushed the bugfix/use-cudaaware-mpi branch from d0c425e to 9bfda6c Compare September 27, 2021 13:03
Pass maps to the post-send and post receive methods by
const reference to avoid deep-copies. Also, mark those
methods as "inline", which might help the compiler.
@gzagaris gzagaris force-pushed the bugfix/use-cudaaware-mpi branch from 9bfda6c to 95f45f3 Compare September 28, 2021 17:36
@gzagaris
Copy link
Copy Markdown
Collaborator Author

Adding the --smpiargs="-gpu" flag to the jsrun command makes this code happy on Ascend. Maybe there is something equivalent on scout...

This works on Ascent, but, it requires the `--smpiargs="-gpu"`
flag to be passed to `jsrun`.
@gzagaris gzagaris force-pushed the bugfix/use-cudaaware-mpi branch from 95f45f3 to 59ae40a Compare September 28, 2021 18:15
@gzagaris gzagaris changed the title [WIP]: Use CUDA-Aware MPI Use CUDA-Aware MPI Sep 28, 2021
Adds cmd line option to enable/disable CUDA-aware MPI.
@gzagaris gzagaris marked this pull request as ready for review September 28, 2021 22:00
@gzagaris
Copy link
Copy Markdown
Collaborator Author

I added a --usecudampi option to fvsand so that we can enable/disable CUDA-aware MPI at the command line as well. This should be safe to merge at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants