# HG changeset patch # User Me # Date 1281346171 25200 # Node ID 833c981134dd1c88c784e0668672129a19aefd92 # Parent b7a974ccc6f4a8dfbaa35bd5fee82d2adf0a7621 Two versions -- normal and sequential for debugging diff -r b7a974ccc6f4 -r 833c981134dd VMSHW_Request_Handlers.c --- a/VMSHW_Request_Handlers.c Wed Jul 28 13:16:31 2010 -0700 +++ b/VMSHW_Request_Handlers.c Mon Aug 09 02:29:31 2010 -0700 @@ -95,8 +95,8 @@ { //waiting request is another send, so stack this up on list semReq-> nextReqInHashEntry = waitingReq->nextReqInHashEntry; waitingReq->nextReqInHashEntry = semReq; - printf("linked requests: %d, %d | ", semReq, waitingReq ); - printf("type: %d, %d\n", semReq->reqType, waitingReq->reqType ); + //printf("linked requests: %d, %d | ", semReq, waitingReq ); + //printf("type: %d, %d\n", semReq->reqType, waitingReq->reqType ); return; } else diff -r b7a974ccc6f4 -r 833c981134dd VMSHW_lib.c --- a/VMSHW_lib.c Wed Jul 28 13:16:31 2010 -0700 +++ b/VMSHW_lib.c Mon Aug 09 02:29:31 2010 -0700 @@ -17,7 +17,13 @@ //========================================================================== void +VMSHW__init(); + +void VMSHW__init_Seq(); + +void +VMSHW__init_Helper(); //========================================================================== @@ -79,13 +85,17 @@ *When all the processors, including the seed, have dissipated, then this * function returns. The results will have been written by side-effect via * pointers read from, or written into initData. + * + *NOTE: no Threads should exist in the outside program that might touch + * any of the data reachable from initData passed in to here */ void VMSHW__create_seed_procr_and_do_work( VirtProcrFnPtr fnPtr, void *initData ) { VMSHWSemEnv *semEnv; VirtProcr *seedProcr; - VMSHW__init(); + VMSHW__init(); //uncomment to do multi-thd +// VMSHW__init_Seq(); //uncomment to debug semEnv = _VMSMasterEnv->semanticEnv; @@ -96,10 +106,8 @@ writePrivQ( seedProcr, semEnv->readyVirtProcrQ ); semEnv->numVirtPr = 1; - //NOTE: no Threads should exist in the outside program that might touch - // any of the data reachable from initData given to the seed procr -// VMS__start_the_work_then_wait_until_done(); - VMS__start_the_work_then_wait_until_done_Seq(); + VMS__start_the_work_then_wait_until_done(); //uncomment to do multi-thd +// VMS__start_the_work_then_wait_until_done_Seq(); //uncomment to debug VMSHW__cleanup_after_shutdown(); } @@ -118,12 +126,26 @@ */ void VMSHW__init() - { VMSHWSemEnv *semanticEnv; + { + VMS__init(); + //masterEnv, a global var, now is partially set up by init_VMS -// VMS__init(); + VMSHW__init_Helper(); + } + +void +VMSHW__init_Seq() + { VMS__init_Seq(); //masterEnv, a global var, now is partially set up by init_VMS + VMSHW__init_Helper(); + } + +void +VMSHW__init_Helper() + { VMSHWSemEnv *semanticEnv; + //Hook up the semantic layer's plug-ins to the Master virt procr _VMSMasterEnv->requestHandler = &VMSHW__Request_Handler; _VMSMasterEnv->slaveScheduler = &VMSHW__schedule_virt_procr;