Incorrect MPI Communicator used

Description

The documentation states that:

The routine cgp_mpi_comm sets the MPI communicator for parallel operations by the CGNS library. The default value is MPI_COMM_WORLD.

However, the library code uses MPI_COMM_WORLD whenever a communicator is needed:

  • src/cgns_io.c: MPI_Bcast(mpibuf, 2, MPI_INT, 0, MPI_COMM_WORLD);

  • src/pcgnslib.c: MPI_Comm_rank(MPI_COMM_WORLD, &rank);

  • src/pcgnslib.c: MPI_Abort(MPI_COMM_WORLD, 1);

  • src/pcgnslib.c: MPI_Comm_rank(MPI_COMM_WORLD, &pcg_mpi_comm_rank);

  • src/pcgnslib.c: MPI_Comm_size(MPI_COMM_WORLD, &pcg_mpi_comm_size);

These should instead be using the communicator specified in the call to cgp_mpi_comm() which currently sets ParallelMPICommunicator which is a static variable in src/adfh/ADFH.c. This communicator is used to set the communicator used by the HDF5 file.

This communicator should be made accessible at the pcgnslib.c and cgns_io.c level and used instead of MPI_COMM_WORLD.

This is currently not affecting us, but will become critical in the near future.

Environment

None

Status

Assignee

Unassigned

Reporter

Gregory Sjaardema

Labels

None

Components

Fix versions

Priority

Major