Hi, All,
Somehow I have to something like the diagram shown below.
W0 W1 W2 W3 W4 W5 .... WN
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
V0 V1 V2 V3 V4 V5 .... VN
W is one program running on different computer nodes from 0 to N and
V is another program running on the same nodes from 0 to N.
Beween W and V there may many other program.
There is a way to pass data between W0 to Wn, V0 to Vn and
We have some way to pass data from W to V (say MPI).
Somehow I need some parameters passed upstream from V to W (ignore any program
in between). I have used Metakit to solve this problem but I have run into trouble.
W on some node cannot get data from V even V has already written down the value
(I used the sample dump program to check it out).
Below is an example I used.
void SetMigrateRunMode(int run_mode)
{
char fname[64];
int iw;
MPI_Comm_rank( DaggerCommSubworld, &iw);
sprintf(fname, "%s%1d%s", "Kmig_run", iw, ".db");
c4_StringProp pName ("name");
c4_IntProp iValue ("ivalue");
c4_Storage kdeck(fname, true);
c4_View runModeView = kdeck.GetAs("runMode[name:S,ivalue:I]");
runModeView.Add(pName["run_mode"] + iValue[run_mode]);
kdeck.Commit();
}
int QueryMigrateRunMode(int *run_mode)
{
char fname[64];
int iw;
MPI_Comm_rank( DaggerCommSubworld, &iw);
sprintf(fname, "%s%1d%s", "Kmig_run", iw, ".db");
c4_Storage kdeck(fname, true);
c4_StringProp pName ("name");
c4_IntProp iValue ("ivalue");
c4_View runModeView = kdeck.View("runMode");
if(runModeView.GetSize()==0) return(false);
*run_mode = iValue(runModeView[0]);
return(true);
}
V calls SetMigrateRunMode to write down the data and
W query the data like this
while(!QueryMigrateRunMode(&kinput->run_mode)) {
sleep(1);
}
Very often W on some node cannot get the data (may be still in the while loop
when the whole thing is down).
Would you anyone kindly point out if I have done anything stupid?
Many thanks.
Jim Hu
