static void testBasic(void) { lpel_config_t cfg; int i; lpel_task_t *trelay, *tcons, *intask; memset(&cfg, 0, sizeof(lpel_config_t)); cfg.num_workers = 2; cfg.proc_workers = 2; cfg.proc_others = 0; cfg.flags = 0; LpelInit(&cfg); LpelStart(&cfg); /* create streams */ sinp = LpelStreamCreate(0); for (i=0; i<NUM_COLL; i++) { scoll[i] = LpelStreamCreate(0); } /* create tasks */ trelay = LpelTaskCreate( 0, Relay, NULL, 8192); LpelTaskStart(trelay); tcons = LpelTaskCreate( 1, Consumer, NULL, 8192); LpelTaskStart(tcons); intask = LpelTaskCreate( -1, Inputter, sinp, 8192); LpelTaskStart(intask); LpelCleanup(); }
int SNetThreadingStop(void) { /* send a stop signal to LPEL */ LpelStop(); /* following call will block until the workers have finished */ LpelCleanup(); return 0; }
static void testBasic(void) { lpel_stream_t *in, *out; lpel_config_t cfg; lpel_task_t *intask, *outtask; mon_task_t *mt; cfg.num_workers = 2; cfg.proc_workers = 2; cfg.proc_others = 0; cfg.flags = 0; cfg.type = HRC_LPEL; unsigned long flags = 1 << 7 - 1; flags=0; // LpelMonInit(&cfg.mon, flags); LpelInit(&cfg); if (SccGetNodeID()==0){ in = LpelStreamCreate(0); out = PipeElement(in, 4); outtask = LpelTaskCreate( -1, Outputter, out, 8192); // mt = LpelMonTaskCreate( LpelTaskGetId(outtask), "outtask"); // LpelTaskMonitor(outtask, mt); LpelTaskStart(outtask); printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! outtask started !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); intask = LpelTaskCreate( -1, Inputter, in, 8192); // mt = LpelMonTaskCreate( LpelTaskGetId(intask), "intask"); // LpelTaskMonitor(intask, mt); LpelTaskStart(intask); printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! intask started !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); } LpelStart(); LpelCleanup(); LpelMonCleanup(); }