@@ -9,6 +9,7 @@ cimport cyprecice
99cimport numpy
1010import numpy as np
1111from mpi4py import MPI
12+
1213import warnings
1314from libcpp.string cimport string
1415from libcpp.vector cimport vector
@@ -63,7 +64,7 @@ cdef class Participant:
6364 Rank of the process
6465 solver_process_size : int
6566 Size of the process
66- communicator: mpi4py.MPI.Intracomm , optional
67+ communicator: mpi4py.MPI.Comm , optional
6768 Custom MPI communicator to use
6869
6970 Returns
@@ -82,10 +83,10 @@ cdef class Participant:
8283 pass
8384
8485 def __cinit__ (self , solver_name , configuration_file_name , solver_process_index , solver_process_size , communicator = None ):
85- cdef void * communicator_ptr
86+ cdef size_t c_comm_addr;
8687 if communicator:
87- communicator_ptr = < void * > communicator
88- self .thisptr = new CppParticipant.Participant (convert(solver_name), convert(configuration_file_name), solver_process_index, solver_process_size, communicator_ptr )
88+ c_comm_addr = MPI._addressof( communicator)
89+ self .thisptr = new CppParticipant.Participant (convert(solver_name), convert(configuration_file_name), solver_process_index, solver_process_size, < void * > c_comm_addr )
8990 else :
9091 self .thisptr = new CppParticipant.Participant (convert(solver_name), convert(configuration_file_name), solver_process_index, solver_process_size)
9192 pass
0 commit comments