How can one host access an attribute of an object that exists on another host?
Specifically, I rewrote some code that refers to the position of the cells in my network. Previously, the cell objects weren't actually 'assigned' positions; the positions were just tracked in a vector where the vector indices corresponded to the cell gids. Now I added x, y, and z positions to the cell templates and tracked the positions in the new x, y, and z attributes. However, it seems that those x, y, and z attributes are only available to the host machine that owns the cell. Should I revert to using the vector that can be accessed by all hosts or is there a way to make the position data accessible to all hosts?
Thanks,
Marianne
Code: Select all
begintemplate GranuleCell
//...
public x, y, z, position
//...
proc position(){x=$1 y=$2 z=$3}
endtemplate GranuleCell
//each object's x, y, and z are set in some other code
//Now I want to access the data and this is the only way I know how:
if (pc.gid_exists(i)) { // Of course the program will fail if I try to refer to a cell on a different host
cell = pc.gid2cell(i) //get the cell reference from the gid
pre_xpos = cell.x // access the x position of the cell
}