NVIDIA / NVIDIA/AMGX

Copy MPI_Comm passed to AMGX_resources_create()

Open
#123 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement tracking internally
Dominant language
Cuda
Stars
692
Forks
197
PR merge metrics
No merged PRs in 30d

Description

AMGX_resources_create() takes a void* comm and calls the constructor of Resources, which copies
the pointer to a member variable

MPI_Comm *m_mpi_comm;

https://github.com/NVIDIA/AMGX/blob/919fb92a2c02ea3d8d3d0f0660e3b507d84705bc/base/src/resources.cu#L153

This prevents the caller from passing a temporary MPI_Comm to AMGX_resources_create(). An alternative is to store a copy of the communicator in:

MPI_Comm m_mpi_comm;

Is there a reason to store the pointer instead?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in base/src/resources.cu at the Resources constructor and the AMGX_resources_create() entry point, then trace how m_mpi_comm is used after construction. Determine whether storing an MPI_Comm value preserves the expected behavior and allows temporary communicators; done means the ownership and lifetime behavior is clear and covered by the relevant existing tests, if any.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.