You are right on the fact that the addresses that
RCCE_mallocreturns are relative to the beginning of the assigned to each core's MPB space.
For this reason, if you want to take the same object that resides on the MPB space of another core you need to do the following:
t_vcharp Y=RCCE_comm_buffer[j] + X - RCCE_comm_buffer[RCCE_ue()];
RCCE_comm_buffer[RCCE_ue()]you manage to get the address of X on the core 0 and by adding
RCCE_comm_buffer[j]you get the address at the node j.
A good example that uses this are the functions
1 of 1 people found this helpful
Suppose core i allocates space for an integer (padded to 32 bytes):
MPB_int *x = (MPB_int *)RCCE_malloc(sizeof(MPB_int));
What you need to know to access x from another core j is the byte offset of x within i's MPB.
If i calculates this offset
int offset = (int)x - (int)RCCE_comm_buffer[i];
and passes it on to j, j can get a pointer to x with
MPB_int *x = RCCE_comm_buffer[i] + offset;
This allows you to break with the symmetric name space model of RCCE.