Tmk_distribute

Francisco Machado (xico@caleida.pt)
Fri, 29 Aug 1997 09:06:45 -0400

Can someone please help me out in figuring out the behaviour of
Tmk_distribute ? I read the message posted sometime ago about it, but I still
need help. The question arises in tsp.c (the Travelling Salesman example that
comes with TMK source).

/* BEGIN SHARED DATA */
GlobalMemory *global = NULL;
/* END SHARED DATA */

int StartNode, TspSize, NodesFromEnd;

Both TspSize and global are global variables. And in the main function
the following appears

(...)

global = (GlobalMemory *) Tmk_malloc(sizeof(GlobalMemory);

(...) initialization of TspSize

TMK_DISTRIBUTE(TspSize);

(...) Initialization of global

TMK_DISTRIBUTE(global);

What is the difference in the usages of TMK_DISTRIBUTE ?

When are data merely copied to the same variable in all the processes ?

When are they placed in shared memory, visible and modifiable by all the
processes ?

Thank you for any answers

Francisco Pereira