@@ -9,6 +9,9 @@ cimport cyprecice
99cimport numpy
1010import numpy as np
1111from mpi4py import MPI
12+ from mpi4py cimport MPI
13+ from mpi4py cimport libmpi
14+
1215import warnings
1316from libcpp.string cimport string
1417from libcpp.vector cimport vector
@@ -63,7 +66,7 @@ cdef class Participant:
6366 Rank of the process
6467 solver_process_size : int
6568 Size of the process
66- communicator: mpi4py.MPI.Intracomm , optional
69+ communicator: mpi4py.MPI.Comm , optional
6770 Custom MPI communicator to use
6871
6972 Returns
@@ -82,10 +85,10 @@ cdef class Participant:
8285 pass
8386
8487 def __cinit__ (self , solver_name , configuration_file_name , solver_process_index , solver_process_size , communicator = None ):
85- cdef void * communicator_ptr
88+ cdef libmpi.MPI_Comm c_comm
8689 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 )
90+ c_comm = ( < MPI.Comm? > communicator).ob_mpi
91+ self .thisptr = new CppParticipant.Participant (convert(solver_name), convert(configuration_file_name), solver_process_index, solver_process_size, < void * > & c_comm )
8992 else :
9093 self .thisptr = new CppParticipant.Participant (convert(solver_name), convert(configuration_file_name), solver_process_index, solver_process_size)
9194 pass
0 commit comments