What is the exact value of MPI_Comm
for processes under the same communicator.
#6174
-
So I see that type I was thinking if I could just make communicator a static variable of a class where all objects are under the same communicator. I tried printing out the values of communicator for all 4 processes under the same 2x2 Cartesian communicator, turns out 3 of them had same value and one different from the others. I tried to probe the source code to see the implementation, I'm not familiar with the C binding process, but seems that it ultimately calls Alternatively I also see it in the mpich-pip repo, the value of newly created Communicator is assigned here, but variable It's pretty obvious I'm very lost here, any advice on how to navigate the MPICH source code would greatly help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You can think The |
Beta Was this translation helpful? Give feedback.
You can think
MPI_Comm
as a pointer to the internal communicator structureMPIR_Comm
. It is an integer because we use an internal object memory allocation system, but it is equivalent to a pointer. Each process does not share the address space, thus you should not expect the handle to have the same value for each process. They can coincidentally share the same value depending on the state of the internal memory allocation, but it is purely coincidental. The same handle can refer to objects with no relationship.The
handle
is defined by the macroMPIR_OBJECT_HEADER
.