doc: Add serial to list of ci file reserved words
[charm.git] / examples / pose / LBSim / sched.C
1 #include "sched.h"
2 #include "sched.def.h"
3 #include "pose.h"
4 #include "SchedSIM_sim.h"
5
6 main::main(CkArgMsg *m) {
7   int i;
8   SchedulerData *sd;
9   eventMsg *m1;
10
11   // check and grab arguments
12   if (m->argc != 6)
13     CmiAbort("Usage: sched <maxObjects> <connectivity> <value> <endTime> <topology>\n");
14   maxObjects = atoi(m->argv[1]);
15   connectivity = atoi(m->argv[2]);
16   n = atoi(m->argv[3]);
17   POSE_endtime= atoi(m->argv[4]);
18  
19   // start simulation
20   POSE_init(POSE_endtime);
21   //POSE_useID();
22     for (i=0; i<maxObjects; i++) {
23     sd = new SchedulerData;
24     sd->maxObjects = maxObjects;
25     sd->connectivity = connectivity;
26     //printf("lbtopo %s\n",m->argv[5]);
27
28     
29     sd->lbtopolen=strlen(m->argv[5]);
30     sd->lbtopo=new char[sd->lbtopolen];
31     strcpy(sd->lbtopo,m->argv[5]);
32     sd->id = i;
33     sd->data=0;
34     sd->sum=0;
35     if(i==0) sd->data=n;
36     sd->Timestamp(0);
37     (*(CProxy_schedulerObject *) &POSE_Objects)[i].insert(sd);
38   }
39     POSE_Objects.doneInserting();
40 }
41
42
43
44