diff --git a/CHANGELOG.md b/CHANGELOG.md index fcb0ccbc..1c58f717 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## latest + +* Fixed passing custom MPI communicators to the Participant https://github.com/precice/python-bindings/pull/256 + ## 3.4.0 * Added support for documentation rendering https://github.com/precice/python-bindings/pull/250 diff --git a/cyprecice/cyprecice.pyx b/cyprecice/cyprecice.pyx index db014b19..22159c84 100644 --- a/cyprecice/cyprecice.pyx +++ b/cyprecice/cyprecice.pyx @@ -63,7 +63,7 @@ cdef class Participant: Rank of the process solver_process_size : int Size of the process - communicator: mpi4py.MPI.Intracomm, optional + communicator: mpi4py.MPI.Comm, optional Custom MPI communicator to use Returns @@ -82,10 +82,10 @@ cdef class Participant: pass def __cinit__ (self, solver_name, configuration_file_name, solver_process_index, solver_process_size, communicator=None): - cdef void* communicator_ptr + cdef size_t c_comm_addr; if communicator: - communicator_ptr = communicator - self.thisptr = new CppParticipant.Participant (convert(solver_name), convert(configuration_file_name), solver_process_index, solver_process_size, communicator_ptr) + c_comm_addr = MPI._addressof(communicator) + self.thisptr = new CppParticipant.Participant (convert(solver_name), convert(configuration_file_name), solver_process_index, solver_process_size, c_comm_addr) else: self.thisptr = new CppParticipant.Participant (convert(solver_name), convert(configuration_file_name), solver_process_index, solver_process_size) pass