# HG changeset patch # User Some Random Person # Date 1331360888 28800 # Node ID 3c9ed64db705f1e851800a6c9081530eafc09dd5 # Parent 471c89d1d5455149d6ff4c898dfb6410ca0f3de5 chgd brch name to Holistic_Model, from perf_ctrs, and Updated to compatibility with common_ancestor brch diff -r 471c89d1d545 -r 3c9ed64db705 .hgeol --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgeol Fri Mar 09 22:28:08 2012 -0800 @@ -0,0 +1,12 @@ + +[patterns] +**.py = native +**.txt = native +**.c = native +**.h = native +**.cpp = native +**.java = native +**.sh = native +**.pl = native +**.jpg = bin +**.gif = bin diff -r 471c89d1d545 -r 3c9ed64db705 DESIGN_NOTES.txt --- a/DESIGN_NOTES.txt Fri Mar 09 19:01:21 2012 +0100 +++ b/DESIGN_NOTES.txt Fri Mar 09 22:28:08 2012 -0800 @@ -1,212 +1,212 @@ - -From e-mail to Albert, on design of app-virt-procr to core-loop animation -switch and back. - -==================== -General warnings about this code: -It only compiles in GCC 4.x (label addr and computed goto) -Has assembly for x86 32bit - - -==================== -AVProcr data-struc has: stack-ptr, jump-ptr, data-ptr, slotNum, coreloop-ptr - and semantic-custom-ptr - -The VMS Creator: takes ptr to function and ptr to initial data --- creates a new AVProcr struc --- sets the jmp-ptr field to the ptr-to-function passed in --- sets the data-ptr to ptr to initial data passed in --- if this is for a suspendable virt processor, then create a stack and set - the stack-ptr - -VMS__create_procr( AVProcrFnPtr fnPtr, void *initialData ) -{ -AVProcr newPr = malloc( sizeof(AVProcr) ); -newPr->jmpPtr = fnPtr; -newPr->coreLoopDonePt = &CoreLoopDonePt; //label is in coreLoop -newPr->data = initialData; -newPr->stackPtr = createNewStack(); -return newPr; -} - -The semantic layer can then add its own state in the cusom-ptr field - -The Scheduler plug-in: --- Sets slave-ptr in AVProcr, and points the slave to AVProcr --- if non-suspendable, sets the AVProcr's stack-ptr to the slave's stack-ptr - -MasterLoop: --- puts AVProcr structures onto the workQ - -CoreLoop: --- gets stack-ptr out of AVProcr and sets the core's stack-ptr to that --- gets data-ptr out of AVProcr and puts it into reg GCC uses for that param --- puts AVProcr's addr into reg GCC uses for the AVProcr-pointer param --- jumps to the addr in AVProcr's jmp-ptr field -CoreLoop() -{ while( FOREVER ) - { nextPr = readQ( workQ ); //workQ is static (global) var declared volatile - = nextPr->data; - = nextPr; - = nextPr->stackPtr; - jmp nextPr->jmpPtr; -CoreLoopDonePt: //label's addr put into AVProcr when create new one - } -} -(Note, for suspendable processors coming back from suspension, there is no - need to fill the parameter registers -- they will be discarded) - -Suspend an application-level virtual processor: -VMS__AVPSuspend( AVProcr *pr ) -{ -pr->jmpPtr = &ResumePt; //label defined a few lines below -pr->slave->doneFlag = TRUE; -pr->stackPtr = ; -jmp pr->coreLoopDonePt; -ResumePt: return; -} - -This works because the core loop will have switched back to this stack - before jumping to ResumePt.. also, the core loop never modifies the - stack pointer, it simply switches to whatever stack pointer is in the - next AVProcr it gets off the workQ. - - - -============================================================================= -As it is now, there's only one major unknown about GCC (first thing below - the line), and there are a few restrictions, the most intrusive being - that the functions the application gives to the semantic layer have a - pre-defined prototype -- return nothing, take a pointer to initial data - and a pointer to an AVProcr struc, which they're not allowed to modify - -- only pass it to semantic-lib calls. - -So, here are the assumptions, restrictions, and so forth: -=========================== -Major assumption: that GCC will do the following the same way every time: - say the application defines a function that fits this typedef: -typedef void (*AVProcrFnPtr) ( void *, AVProcr * ); - -and let's say somewhere in the code they do this: -AVProcrFnPtr fnPtr = &someFunc; - -then they do this: -(*fnPtr)( dataPtr, animatingVirtProcrPtr ); - -Can the registers that GCC uses to pass the two pointers be predicted? - Will they always be the same registers, in every program that has the - same typedef? -If that typedef fixes, guaranteed, the registers (on x86) that GCC will use - to send the two pointers, then the rest of this solution works. - -Change in model: Instead of a virtual processor whose execution trace is - divided into work-units, replacing that with the pattern that a virtual - processor is suspended. Which means, no more "work unit" data structure - -- instead, it's now an "Application Virtual Processor" structure - -- AVProcr -- which is given directly to the application function! - - -- You were right, don't need slaves to be virtual processors, only need - "scheduling buckets" -- just a way to keep track of things.. - -Restrictions: --- the "virtual entities" created by the semantic layer must be virtual - processors, created with a function-to-execute and initial data -- the - function is restricted to return nothing and only take a pointer to the - initial data plus a pointer to an AVProcr structure, which represents - "self", the virtual processor created. (This is the interface I showed - you for "Hello World" semantic layer). -What this means for synchronous dataflow, is that the nodes in the graph - are virtual processors that in turn spawn a new virtual processor for - every "firing" of the node. This should be fine because the function - that the node itself is created with is a "canned" function that is part - of the semantic layer -- the function that is spawned is the user-provided - function. The restriction only means that the values from the inputs to - the node are packaged as the "initial data" given to the spawned virtual - processor -- so the user-function has to cast a void * to the - semantic-layer-defined structure by which it gets the inputs to the node. - --- Second restriction is that the semantic layer has to use VMS supplied - stuff -- for example, the data structure that represents the - application-level virtual processor is defined in VMS, and the semantic - layer has to call a VMS function in order to suspend a virtual processor. - --- Third restriction is that the application code never do anything with - the AVProcr structure except pass it to semantic-layer lib calls. - --- Fourth restriction is that every virtual processor must call a - "dissipate" function as its last act -- the user-supplied - virtual-processor function can't just end -- it has to call - SemLib__dissipate( AVProcr ) before the closing brace.. and after the - semantic layer is done cleaning up its own data, it has to in turn call - VMS__disspate( AVProcr ). - --- For performance reasons, I think I want to have two different kinds of - app-virtual processor -- suspendable ones and non-suspendable -- where - non-suspendable are not allowed to perform any communication with other - virtual processors, except at birth and death. Suspendable ones, of - course can perform communications, create other processors, and so forth - -- all of which cause it to suspend. -The performance difference is that I need a separate stack for each - suspendable, but non-suspendable can re-use a fixed number of stacks - (one for each slave). - - -==================== May 29 - -Qs: ---1 how to safely jump between virt processor's trace and coreloop ---2 how to set up __cdecl style stack + frame for just-born virtual processor ---3 how to switch stack-pointers + frame-pointers - - ---1: -Not sure if GCC's computed goto is safe, because modify the stack pointer -without GCC's knowledge -- although, don't use the stack in the coreloop -segment, so, actually, that should be safe! - -So, GCC has its own special C extensions, one of which gets address of label: - -void *labelAddr; -labelAddr = &&label; -goto *labelAddr; - ---2 -In CoreLoop, will check whether VirtProc just born, or was suspended. -If just born, do bit of code that sets up the virtual processor's stack -and frame according to the __cdecl convention for the standard virt proc -fn typedef -- save the pointer to data and pointer to virt proc struc into -correct places in the frame - __cdecl says, according to: -http://unixwiz.net/techtips/win32-callconv-asm.html -To do this: -push the parameters onto the stack, right most first, working backwards to - the left. -Then perform call instr, which pushes return addr onto stack. -Then callee first pushes the frame pointer, %EBP followed by placing the -then-current value of stack pointer into %EBP -push ebp -mov ebp, esp // ebp « esp - -Once %ebp has been changed, it can now refer directly to the function's - arguments as 8(%ebp), 12(%ebp). Note that 0(%ebp) is the old base pointer - and 4(%ebp) is the old instruction pointer. - -Then callee pushes regs it will use then adds to stack pointer the size of - its local vars. - -Stack in callee looks like this: -16(%ebp) - third function parameter -12(%ebp) - second function parameter -8(%ebp) - first function parameter -4(%ebp) - old %EIP (the function's "return address") -----------^^ State seen at first instr of callee ^^----------- -0(%ebp) - old %EBP (previous function's base pointer) --4(%ebp) - save of EAX, the only reg used in function --8(%ebp) - first local variable --12(%ebp) - second local variable --16(%ebp) - third local variable - - ---3 -It might be just as simple as two mov instrs, one for %ESP, one for %EBP.. - the stack and frame pointer regs + +From e-mail to Albert, on design of app-virt-procr to core-loop animation +switch and back. + +==================== +General warnings about this code: +It only compiles in GCC 4.x (label addr and computed goto) +Has assembly for x86 32bit + + +==================== +AVProcr data-struc has: stack-ptr, jump-ptr, data-ptr, slotNum, coreloop-ptr + and semantic-custom-ptr + +The VMS Creator: takes ptr to function and ptr to initial data +-- creates a new AVProcr struc +-- sets the jmp-ptr field to the ptr-to-function passed in +-- sets the data-ptr to ptr to initial data passed in +-- if this is for a suspendable virt processor, then create a stack and set + the stack-ptr + +VMS_int__create_slaveVP( AVProcrFnPtr fnPtr, void *initialData ) +{ +AVProcr newSlv = malloc( sizeof(AVProcr) ); +newSlv->jmpPtr = fnPtr; +newSlv->coreLoopDonePt = &CoreLoopDonePt; //label is in coreLoop +newSlv->data = initialData; +newSlv->stackPtr = createNewStack(); +return newSlv; +} + +The semantic layer can then add its own state in the cusom-ptr field + +The Scheduler plug-in: +-- Sets slave-ptr in AVProcr, and points the slave to AVProcr +-- if non-suspendable, sets the AVProcr's stack-ptr to the slave's stack-ptr + +MasterLoop: +-- puts AVProcr structures onto the workQ + +CoreLoop: +-- gets stack-ptr out of AVProcr and sets the core's stack-ptr to that +-- gets data-ptr out of AVProcr and puts it into reg GCC uses for that param +-- puts AVProcr's addr into reg GCC uses for the AVProcr-pointer param +-- jumps to the addr in AVProcr's jmp-ptr field +CoreLoop() +{ while( FOREVER ) + { nextSlv = readQ( workQ ); //workQ is static (global) var declared volatile + = nextSlv->data; + = nextSlv; + = nextSlv->stackPtr; + jmp nextSlv->jmpPtr; +CoreLoopDonePt: //label's addr put into AVProcr when create new one + } +} +(Note, for suspendable processors coming back from suspension, there is no + need to fill the parameter registers -- they will be discarded) + +Suspend an application-level virtual processor: +VMS_int__AVPSuspend( AVProcr *pr ) +{ +pr->jmpPtr = &ResumePt; //label defined a few lines below +pr->slave->doneFlag = TRUE; +pr->stackPtr = ; +jmp pr->coreLoopDonePt; +ResumePt: return; +} + +This works because the core loop will have switched back to this stack + before jumping to ResumePt.. also, the core loop never modifies the + stack pointer, it simply switches to whatever stack pointer is in the + next AVProcr it gets off the workQ. + + + +============================================================================= +As it is now, there's only one major unknown about GCC (first thing below + the line), and there are a few restrictions, the most intrusive being + that the functions the application gives to the semantic layer have a + pre-defined prototype -- return nothing, take a pointer to initial data + and a pointer to an AVProcr struc, which they're not allowed to modify + -- only pass it to semantic-lib calls. + +So, here are the assumptions, restrictions, and so forth: +=========================== +Major assumption: that GCC will do the following the same way every time: + say the application defines a function that fits this typedef: +typedef void (*AVProcrFnPtr) ( void *, AVProcr * ); + +and let's say somewhere in the code they do this: +AVProcrFnPtr fnPtr = &someFunc; + +then they do this: +(*fnPtr)( dataPtr, animatingSlaveVPPtr ); + +Can the registers that GCC uses to pass the two pointers be predicted? + Will they always be the same registers, in every program that has the + same typedef? +If that typedef fixes, guaranteed, the registers (on x86) that GCC will use + to send the two pointers, then the rest of this solution works. + +Change in model: Instead of a virtual processor whose execution trace is + divided into work-units, replacing that with the pattern that a virtual + processor is suspended. Which means, no more "work unit" data structure + -- instead, it's now an "Application Virtual Processor" structure + -- AVProcr -- which is given directly to the application function! + + -- You were right, don't need slaves to be virtual processors, only need + "scheduling buckets" -- just a way to keep track of things.. + +Restrictions: +-- the "virtual entities" created by the semantic layer must be virtual + processors, created with a function-to-execute and initial data -- the + function is restricted to return nothing and only take a pointer to the + initial data plus a pointer to an AVProcr structure, which represents + "self", the virtual processor created. (This is the interface I showed + you for "Hello World" semantic layer). +What this means for synchronous dataflow, is that the nodes in the graph + are virtual processors that in turn spawn a new virtual processor for + every "firing" of the node. This should be fine because the function + that the node itself is created with is a "canned" function that is part + of the semantic layer -- the function that is spawned is the user-provided + function. The restriction only means that the values from the inputs to + the node are packaged as the "initial data" given to the spawned virtual + processor -- so the user-function has to cast a void * to the + semantic-layer-defined structure by which it gets the inputs to the node. + +-- Second restriction is that the semantic layer has to use VMS supplied + stuff -- for example, the data structure that represents the + application-level virtual processor is defined in VMS, and the semantic + layer has to call a VMS function in order to suspend a virtual processor. + +-- Third restriction is that the application code never do anything with + the AVProcr structure except pass it to semantic-layer lib calls. + +-- Fourth restriction is that every virtual processor must call a + "dissipate" function as its last act -- the user-supplied + virtual-processor function can't just end -- it has to call + SemLib__dissipate( AVProcr ) before the closing brace.. and after the + semantic layer is done cleaning up its own data, it has to in turn call + VMS_int__disspate( AVProcr ). + +-- For performance reasons, I think I want to have two different kinds of + app-virtual processor -- suspendable ones and non-suspendable -- where + non-suspendable are not allowed to perform any communication with other + virtual processors, except at birth and death. Suspendable ones, of + course can perform communications, create other processors, and so forth + -- all of which cause it to suspend. +The performance difference is that I need a separate stack for each + suspendable, but non-suspendable can re-use a fixed number of stacks + (one for each slave). + + +==================== May 29 + +Qs: +--1 how to safely jump between virt processor's trace and coreloop +--2 how to set up __cdecl style stack + frame for just-born virtual processor +--3 how to switch stack-pointers + frame-pointers + + +--1: +Not sure if GCC's computed goto is safe, because modify the stack pointer +without GCC's knowledge -- although, don't use the stack in the coreloop +segment, so, actually, that should be safe! + +So, GCC has its own special C extensions, one of which gets address of label: + +void *labelAddr; +labelAddr = &&label; +goto *labelAddr; + +--2 +In CoreLoop, will check whether VirtProc just born, or was suspended. +If just born, do bit of code that sets up the virtual processor's stack +and frame according to the __cdecl convention for the standard virt proc +fn typedef -- save the pointer to data and pointer to virt proc struc into +correct places in the frame + __cdecl says, according to: +http://unixwiz.net/techtips/win32-callconv-asm.html +To do this: +push the parameters onto the stack, right most first, working backwards to + the left. +Then perform call instr, which pushes return addr onto stack. +Then callee first pushes the frame pointer, %EBP followed by placing the +then-current value of stack pointer into %EBP +push ebp +mov ebp, esp // ebp « esp + +Once %ebp has been changed, it can now refer directly to the function's + arguments as 8(%ebp), 12(%ebp). Note that 0(%ebp) is the old base pointer + and 4(%ebp) is the old instruction pointer. + +Then callee pushes regs it will use then adds to stack pointer the size of + its local vars. + +Stack in callee looks like this: +16(%ebp) - third function parameter +12(%ebp) - second function parameter +8(%ebp) - first function parameter +4(%ebp) - old %EIP (the function's "return address") +----------^^ State seen at first instr of callee ^^----------- +0(%ebp) - old %EBP (previous function's base pointer) +-4(%ebp) - save of EAX, the only reg used in function +-8(%ebp) - first local variable +-12(%ebp) - second local variable +-16(%ebp) - third local variable + + +--3 +It might be just as simple as two mov instrs, one for %ESP, one for %EBP.. + the stack and frame pointer regs diff -r 471c89d1d545 -r 3c9ed64db705 SSR.h --- a/SSR.h Fri Mar 09 19:01:21 2012 +0100 +++ b/SSR.h Fri Mar 09 22:28:08 2012 -0800 @@ -9,9 +9,9 @@ #ifndef _SSR_H #define _SSR_H -#include "../../C_Libraries/Queue_impl/PrivateQueue.h" -#include "../../C_Libraries/Hash_impl/PrivateHash.h" -#include "../VMS_impl/VMS.h" +#include "Queue_impl/PrivateQueue.h" +#include "Hash_impl/PrivateHash.h" +#include "VMS_impl/VMS.h" #include "dependency.h" @@ -31,7 +31,7 @@ typedef struct { - VirtProcr *VPCurrentlyExecuting; + SlaveVP *VPCurrentlyExecuting; PrivQueueStruc *waitingVPQ; } SSRTrans; @@ -69,14 +69,14 @@ struct _SSRSemReq { enum SSRReqType reqType; - VirtProcr *sendPr; - VirtProcr *receivePr; + SlaveVP *sendPr; + SlaveVP *receivePr; int32 msgType; void *msg; SSRSemReq *nextReqInHashEntry; void *initData; - VirtProcrFnPtr fnPtr; + TopLevelFnPtr fnPtr; int32 coreToScheduleOnto; int32 sizeToMalloc; @@ -97,7 +97,7 @@ { PrivQueueStruc **readyVPQs; HashTable *commHashTbl; - int32 numVirtPr; + int32 numSlaveVP; int32 nextCoreToGetNewPr; int32 primitiveStartTime; @@ -105,7 +105,7 @@ SSRSingleton fnSingletons[NUM_STRUCS_IN_SEM_ENV]; SSRTrans transactionStrucs[NUM_STRUCS_IN_SEM_ENV]; - #ifdef OBSERVE_UCC + #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC ListOfArrays* unitList; ListOfArrays* ctlDependenciesList; ListOfArrays* commDependenciesList; @@ -116,10 +116,10 @@ ListOfArrays* hwArcs; #endif - #ifdef MEAS__PERF_COUNTERS + #ifdef HOLISTIC__TURN_ON_PERF_COUNTERS ListOfArrays* counterList[NUM_CORES]; #endif - VirtProcr* idlePr[NUM_CORES][NUM_SCHED_SLOTS]; + SlaveVP* idlePr[NUM_CORES][NUM_SCHED_SLOTS]; } SSRSemEnv; @@ -142,7 +142,7 @@ //=========================================================================== void -SSR__create_seed_procr_and_do_work( VirtProcrFnPtr fn, void *initData ); +SSR__create_seed_procr_and_do_work( TopLevelFnPtr fn, void *initData ); int32 SSR__giveMinWorkUnitCycles( float32 percentOverhead ); @@ -169,33 +169,33 @@ //======================= - VirtProcr * -SSR__create_procr_with( VirtProcrFnPtr fnPtr, void *initData, - VirtProcr *creatingPr ); + SlaveVP * +SSR__create_procr_with( TopLevelFnPtr fnPtr, void *initData, + SlaveVP *creatingSlv ); - VirtProcr * -SSR__create_procr_with_affinity( VirtProcrFnPtr fnPtr, void *initData, - VirtProcr *creatingPr, int32 coreToScheduleOnto); + SlaveVP * +SSR__create_procr_with_affinity( TopLevelFnPtr fnPtr, void *initData, + SlaveVP *creatingPr, int32 coreToScheduleOnto); void -SSR__dissipate_procr( VirtProcr *procrToDissipate ); +SSR__dissipate_procr( SlaveVP *procrToDissipate ); //======================= void * -SSR__malloc_to( int numBytes, VirtProcr *ownerPr ); +SSR__malloc_to( int numBytes, SlaveVP *ownerSlv ); void -SSR__free( void *ptrToFree, VirtProcr *owningPr ); +SSR__free( void *ptrToFree, SlaveVP *owningSlv ); void -SSR__transfer_ownership_of_from_to( void *data, VirtProcr *oldOwnerPr, - VirtProcr *newOwnerPr ); +SSR__transfer_ownership_of_from_to( void *data, SlaveVP *oldOwnerPr, + SlaveVP *newOwnerSlv ); void -SSR__add_ownership_by_to( VirtProcr *newOwnerPr, void *data ); +SSR__add_ownership_by_to( SlaveVP *newOwnerPr, void *data ); void -SSR__remove_ownership_by_from( VirtProcr *loserPr, void *dataLosing ); +SSR__remove_ownership_by_from( SlaveVP *loserPr, void *dataLosing ); void SSR__transfer_ownership_to_outside( void *dataToTransferOwnershipOf ); @@ -204,52 +204,52 @@ //======================= void -SSR__send_of_type_to( VirtProcr *sendPr, void *msg, const int type, - VirtProcr *receivePr); +SSR__send_of_type_to( SlaveVP *sendPr, void *msg, const int type, + SlaveVP *receivePr); void -SSR__send_from_to( void *msg, VirtProcr *sendPr, VirtProcr *receivePr); +SSR__send_from_to( void *msg, SlaveVP *sendPr, SlaveVP *receivePr); void * -SSR__receive_type_to( const int type, VirtProcr *receivePr ); +SSR__receive_type_to( const int type, SlaveVP *receiveSlv ); void * -SSR__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr ); +SSR__receive_from_to( SlaveVP *sendPr, SlaveVP *receiveSlv ); //======================= Concurrency Stuff ====================== void -SSR__start_fn_singleton( int32 singletonID, VirtProcr *animPr ); +SSR__start_fn_singleton( int32 singletonID, SlaveVP *animSlv ); void -SSR__end_fn_singleton( int32 singletonID, VirtProcr *animPr ); +SSR__end_fn_singleton( int32 singletonID, SlaveVP *animSlv ); void -SSR__start_data_singleton( SSRSingleton **singeltonAddr, VirtProcr *animPr ); +SSR__start_data_singleton( SSRSingleton **singeltonAddr, SlaveVP *animSlv ); void -SSR__end_data_singleton( SSRSingleton **singletonAddr, VirtProcr *animPr ); +SSR__end_data_singleton( SSRSingleton **singletonAddr, SlaveVP *animSlv ); void SSR__animate_short_fn_in_isolation( PtrToAtomicFn ptrToFnToExecInMaster, - void *data, VirtProcr *animPr ); + void *data, SlaveVP *animSlv ); void -SSR__start_transaction( int32 transactionID, VirtProcr *animPr ); +SSR__start_transaction( int32 transactionID, SlaveVP *animSlv ); void -SSR__end_transaction( int32 transactionID, VirtProcr *animPr ); +SSR__end_transaction( int32 transactionID, SlaveVP *animSlv ); //========================= Internal use only ============================= void -SSR__Request_Handler( VirtProcr *requestingPr, void *_semEnv ); +SSR__Request_Handler( SlaveVP *requestingPr, void *_semEnv ); -VirtProcr * -SSR__schedule_virt_procr( void *_semEnv, int coreNum, int slotNum ); +SlaveVP * +SSR__schedule_slaveVP( void *_semEnv, int coreNum, int slotNum ); -VirtProcr* -SSR__create_procr_helper( VirtProcrFnPtr fnPtr, void *initData, +SlaveVP* +SSR__create_procr_helper( TopLevelFnPtr fnPtr, void *initData, SSRSemEnv *semEnv, int32 coreToScheduleOnto ); #endif /* _SSR_H */ diff -r 471c89d1d545 -r 3c9ed64db705 SSR_Counter_Recording.c --- a/SSR_Counter_Recording.c Fri Mar 09 19:01:21 2012 +0100 +++ b/SSR_Counter_Recording.c Fri Mar 09 22:28:08 2012 -0800 @@ -1,7 +1,14 @@ +/* + * + * author: Nina Engelhardt + */ + #include "SSR_Counter_Recording.h" -#include "../VMS_impl/VMS.h" +#include "VMS_impl/VMS.h" #include "SSR.h" +#ifdef HOLISTIC__TURN_ON_PERF_COUNTERS + void SSR__init_counter_data_structs(){ SSRSemEnv *semanticEnv = _VMSMasterEnv->semanticEnv; int i; @@ -21,7 +28,7 @@ list->next_free_index++; } -void SSR__counter_handler(int evt_type, int vpid, int task, VirtProcr* pr, uint64 cycles, uint64 instrs) +void SSR__counter_handler(int evt_type, int vpid, int task, SlaveVP* pr, uint64 cycles, uint64 instrs) { if (pr->isMasterVP || pr->isShutdownVP) { //Save only values for actual work @@ -109,4 +116,5 @@ fprintf(counterfile,", %d",e->coreID); fprintf(counterfile,"\n"); fflush(counterfile); -} \ No newline at end of file +} +#endif diff -r 471c89d1d545 -r 3c9ed64db705 SSR_Counter_Recording.h --- a/SSR_Counter_Recording.h Fri Mar 09 19:01:21 2012 +0100 +++ b/SSR_Counter_Recording.h Fri Mar 09 22:28:08 2012 -0800 @@ -8,7 +8,7 @@ #ifndef SSR_COUNTER_RECORDING_H #define SSR_COUNTER_RECORDING_H -#include "../VMS_impl/VMS.h" +#include "VMS_impl/VMS.h" typedef struct { int event_type; @@ -24,7 +24,7 @@ void SSR__init_counter_data_structs(); -void SSR__counter_handler(int evt_type, int vpid, int task, VirtProcr* pr, uint64 cycles, uint64 instrs); +void SSR__counter_handler(int evt_type, int vpid, int task, SlaveVP* pr, uint64 cycles, uint64 instrs); void set_counter_file(FILE* f); diff -r 471c89d1d545 -r 3c9ed64db705 SSR_PluginFns.c --- a/SSR_PluginFns.c Fri Mar 09 19:01:21 2012 +0100 +++ b/SSR_PluginFns.c Fri Mar 09 22:28:08 2012 -0800 @@ -13,16 +13,16 @@ //=========================== Local Fn Prototypes =========================== void -resume_procr( VirtProcr *procr, SSRSemEnv *semEnv ); +resume_slaveVP( SlaveVP *procr, SSRSemEnv *semEnv ); void -handleSemReq( VMSReqst *req, VirtProcr *requestingPr, SSRSemEnv *semEnv ); +handleSemReq( VMSReqst *req, SlaveVP *requestingPr, SSRSemEnv *semEnv ); void -handleDissipate( VirtProcr *requestingPr, SSRSemEnv *semEnv ); +handleDissipate( SlaveVP *requestingPr, SSRSemEnv *semEnv ); void -handleCreate( VMSReqst *req, VirtProcr *requestingPr, SSRSemEnv *semEnv ); +handleCreate( VMSReqst *req, SlaveVP *requestingPr, SSRSemEnv *semEnv ); //============================== Scheduler ================================== @@ -35,9 +35,9 @@ */ char __Scheduler[] = "FIFO Scheduler"; //Gobal variable for name in saved histogram -VirtProcr * -SSR__schedule_virt_procr( void *_semEnv, int coreNum, int slotNum ) - { VirtProcr *schedPr; +SlaveVP * +SSR__schedule_slaveVP( void *_semEnv, int coreNum, int slotNum ) + { SlaveVP *schedPr; SSRSemEnv *semEnv; semEnv = (SSRSemEnv *)_semEnv; @@ -47,24 +47,24 @@ if(!schedPr){ schedPr = semEnv->idlePr[coreNum][slotNum]; //things that would normally happen in resume(), but these VPs never go there - #ifdef OBSERVE_UCC + #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC schedPr->numTimesScheduled++; //Somewhere here! Unit newu; - newu.vp = schedPr->procrID; + newu.vp = schedPr->slaveID; newu.task = schedPr->numTimesScheduled; addToListOfArrays(Unit,newu,semEnv->unitList); if (schedPr->numTimesScheduled > 1){ Dependency newd; - newd.from_vp = schedPr->procrID; + newd.from_vp = schedPr->slaveID; newd.from_task = schedPr->numTimesScheduled - 1; - newd.to_vp = schedPr->procrID; + newd.to_vp = schedPr->slaveID; newd.to_task = schedPr->numTimesScheduled; addToListOfArrays(Dependency, newd ,semEnv->ctlDependenciesList); } #endif } - #ifdef OBSERVE_UCC + #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC if (schedPr) { //schedPr->numTimesScheduled++; Unit prev_in_slot = semEnv->last_in_slot[coreNum * NUM_SCHED_SLOTS + slotNum]; @@ -72,11 +72,11 @@ Dependency newd; newd.from_vp = prev_in_slot.vp; newd.from_task = prev_in_slot.task; - newd.to_vp = schedPr->procrID; + newd.to_vp = schedPr->slaveID; newd.to_task = schedPr->numTimesScheduled; addToListOfArrays(Dependency,newd,semEnv->hwArcs); } - prev_in_slot.vp = schedPr->procrID; + prev_in_slot.vp = schedPr->slaveID; prev_in_slot.task = schedPr->numTimesScheduled; semEnv->last_in_slot[coreNum * NUM_SCHED_SLOTS + slotNum] = prev_in_slot; } @@ -98,13 +98,13 @@ * Processor, and initial data. */ void -SSR__Request_Handler( VirtProcr *requestingPr, void *_semEnv ) +SSR__Request_Handler( SlaveVP *requestingPr, void *_semEnv ) { SSRSemEnv *semEnv; VMSReqst *req; semEnv = (SSRSemEnv *)_semEnv; - req = VMS__take_next_request_out_of( requestingPr ); + req = VMS_PI__take_next_request_out_of( requestingPr ); while( req != NULL ) { @@ -115,24 +115,24 @@ break; case dissipate: handleDissipate( requestingPr, semEnv); break; - case VMSSemantic: VMS__handle_VMSSemReq(req, requestingPr, semEnv, - &resume_procr); + case VMSSemantic: VMS_PI__handle_VMSSemReq(req, requestingPr, semEnv, + &resume_slaveVP); break; default: break; } - req = VMS__take_next_request_out_of( requestingPr ); + req = VMS_PI__take_next_request_out_of( requestingPr ); } //while( req != NULL ) } void -handleSemReq( VMSReqst *req, VirtProcr *reqPr, SSRSemEnv *semEnv ) +handleSemReq( VMSReqst *req, SlaveVP *reqPr, SSRSemEnv *semEnv ) { SSRSemReq *semReq; - semReq = VMS__take_sem_reqst_from(req); + semReq = VMS_PI__take_sem_reqst_from(req); if( semReq == NULL ) return; switch( semReq->reqType ) //sem handlers are all in other file { @@ -174,43 +174,43 @@ //=========================== VMS Request Handlers ============================== // void -handleDissipate( VirtProcr *requestingPr, SSRSemEnv *semEnv ) +handleDissipate( SlaveVP *requestingPr, SSRSemEnv *semEnv ) { - DEBUG1(dbgRqstHdlr,"Dissipate request from processor %d\n",requestingPr->procrID) + DEBUG1(dbgRqstHdlr,"Dissipate request from processor %d\n",requestingPr->slaveID) //free any semantic data allocated to the virt procr - VMS__free( requestingPr->semanticData ); + VMS_PI__free( requestingPr->semanticData ); //Now, call VMS to free_all AppVP state -- stack and so on - VMS__dissipate_procr( requestingPr ); + VMS_PI__dissipate_slaveVP( requestingPr ); - semEnv->numVirtPr -= 1; - if( semEnv->numVirtPr == 0 ) + semEnv->numSlaveVP -= 1; + if( semEnv->numSlaveVP == 0 ) { //no more work, so shutdown - VMS__shutdown(); + VMS_SS__shutdown(); } } /*Re-use this in the entry-point fn */ - VirtProcr * -SSR__create_procr_helper( VirtProcrFnPtr fnPtr, void *initData, + SlaveVP * +SSR__create_procr_helper( TopLevelFnPtr fnPtr, void *initData, SSRSemEnv *semEnv, int32 coreToScheduleOnto ) - { VirtProcr *newPr; + { SlaveVP *newPr; SSRSemData *semData; //This is running in master, so use internal version - newPr = VMS__create_procr( fnPtr, initData ); + newPr = VMS_PI__create_slaveVP( fnPtr, initData ); - semEnv->numVirtPr += 1; + semEnv->numSlaveVP += 1; - semData = VMS__malloc( sizeof(SSRSemData) ); + semData = VMS_PI__malloc( sizeof(SSRSemData) ); semData->highestTransEntered = -1; semData->lastTransEntered = NULL; newPr->semanticData = semData; //=================== Assign new processor to a core ===================== - #ifdef SEQUENTIAL + #ifdef DEBUG__TURN_ON_SEQUENTIAL_MODE newPr->coreAnimatedBy = 0; #else @@ -234,24 +234,24 @@ } void -handleCreate( VMSReqst *req, VirtProcr *requestingPr, SSRSemEnv *semEnv ) +handleCreate( VMSReqst *req, SlaveVP *requestingPr, SSRSemEnv *semEnv ) { SSRSemReq *semReq; - VirtProcr *newPr; + SlaveVP *newPr; - DEBUG1(dbgRqstHdlr,"Create request from processor %d ",requestingPr->procrID) + DEBUG1(dbgRqstHdlr,"Create request from processor %d ",requestingPr->slaveID) - semReq = VMS__take_sem_reqst_from( req ); + semReq = VMS_PI__take_sem_reqst_from( req ); newPr = SSR__create_procr_helper( semReq->fnPtr, semReq->initData, semEnv, semReq->coreToScheduleOnto ); - DEBUG1(dbgRqstHdlr,"(new VP: %d)\n",newPr->procrID) + DEBUG1(dbgRqstHdlr,"(new VP: %d)\n",newPr->slaveID) - #ifdef OBSERVE_UCC + #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC Dependency newd; - newd.from_vp = requestingPr->procrID; + newd.from_vp = requestingPr->slaveID; newd.from_task = requestingPr->numTimesScheduled; - newd.to_vp = newPr->procrID; + newd.to_vp = newPr->slaveID; newd.to_task = 1; //addToListOfArraysDependency(newd,semEnv->commDependenciesList); addToListOfArrays(Dependency,newd,semEnv->commDependenciesList); @@ -260,34 +260,34 @@ //For SSR, caller needs ptr to created processor returned to it requestingPr->dataRetFromReq = newPr; - resume_procr( newPr, semEnv ); - resume_procr( requestingPr, semEnv ); + resume_slaveVP( newPr, semEnv ); + resume_slaveVP( requestingPr, semEnv ); } //=========================== Helper ============================== void -resume_procr( VirtProcr *procr, SSRSemEnv *semEnv ) +resume_slaveVP( SlaveVP *procr, SSRSemEnv *semEnv ) { - #ifdef MEAS__PERF_COUNTERS + #ifdef HOLISTIC__TURN_ON_PERF_COUNTERS /* int lastRecordIdx = procr->counter_history_array_info->numInArray -1; CounterRecord* lastRecord = procr->counter_history[lastRecordIdx]; saveLowTimeStampCountInto(lastRecord->unblocked_timestamp); */ #endif - #ifdef OBSERVE_UCC + #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC procr->numTimesScheduled++; //Somewhere here! Unit newu; - newu.vp = procr->procrID; + newu.vp = procr->slaveID; newu.task = procr->numTimesScheduled; addToListOfArrays(Unit,newu,semEnv->unitList); if (procr->numTimesScheduled > 1){ Dependency newd; - newd.from_vp = procr->procrID; + newd.from_vp = procr->slaveID; newd.from_task = procr->numTimesScheduled - 1; - newd.to_vp = procr->procrID; + newd.to_vp = procr->slaveID; newd.to_task = procr->numTimesScheduled; addToListOfArrays(Dependency, newd ,semEnv->ctlDependenciesList); } diff -r 471c89d1d545 -r 3c9ed64db705 SSR_Request_Handlers.c --- a/SSR_Request_Handlers.c Fri Mar 09 19:01:21 2012 +0100 +++ b/SSR_Request_Handlers.c Fri Mar 09 22:28:08 2012 -0800 @@ -7,16 +7,16 @@ #include #include -#include "../VMS_impl/VMS.h" -#include "../../C_Libraries/Queue_impl/PrivateQueue.h" -#include "../../C_Libraries/Hash_impl/PrivateHash.h" +#include "VMS_impl/VMS.h" +#include "Queue_impl/PrivateQueue.h" +#include "Hash_impl/PrivateHash.h" #include "SSR.h" //=========================== Local Fn Prototypes =========================== void -resume_procr( VirtProcr *procr, SSRSemEnv *semEnv ); +resume_slaveVP( SlaveVP *procr, SSRSemEnv *semEnv ); @@ -29,7 +29,7 @@ cloneReq( SSRSemReq *semReq ) { SSRSemReq *clonedReq; - clonedReq = VMS__malloc( sizeof(SSRSemReq) ); + clonedReq = VMS_PI__malloc( sizeof(SSRSemReq) ); clonedReq->reqType = semReq->reqType; clonedReq->sendPr = semReq->sendPr; clonedReq->msg = semReq->msg; @@ -83,13 +83,13 @@ */ void handleSendType( SSRSemReq *semReq, SSRSemEnv *semEnv ) - { VirtProcr *sendPr, *receivePr; + { SlaveVP *sendPr, *receivePr; int key[] = {0,0,0}; SSRSemReq *waitingReq; HashEntry *entry; HashTable *commHashTbl = semEnv->commHashTbl; - DEBUG1(dbgRqstHdlr,"SendType request from processor %d\n",semReq->sendPr->procrID) + DEBUG1(dbgRqstHdlr,"SendType request from processor %d\n",semReq->sendPr->slaveID) receivePr = semReq->receivePr; //For "send", know both send & recv procrs sendPr = semReq->sendPr; @@ -101,7 +101,7 @@ // list when multiple have the same key. //TODO: use a faster hash function -- see notes in intelligence gather - key[0] = (int)receivePr->procrID; + key[0] = (int)receivePr->slaveID; key[1] = (int)(semReq->msgType); //key[2] acts as the 0 that terminates the string @@ -126,11 +126,11 @@ } else { - #ifdef OBSERVE_UCC + #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC Dependency newd; - newd.from_vp = sendPr->procrID; + newd.from_vp = sendPr->slaveID; newd.from_task = sendPr->numTimesScheduled; - newd.to_vp = receivePr->procrID; + newd.to_vp = receivePr->slaveID; newd.to_task = receivePr->numTimesScheduled +1; //(newd,semEnv->commDependenciesList); addToListOfArrays(Dependency,newd,semEnv->dynDependenciesList); @@ -142,10 +142,10 @@ semEnv->ntonGroups[groupId] = new_NtoN(groupId); } Unit u; - u.vp = sendPr->procrID; + u.vp = sendPr->slaveID; u.task = sendPr->numTimesScheduled; addToListOfArrays(Unit,u,semEnv->ntonGroups[groupId]->senders); - u.vp = receivePr->procrID; + u.vp = receivePr->slaveID; u.task = receivePr->numTimesScheduled +1; addToListOfArrays(Unit,u,semEnv->ntonGroups[groupId]->receivers); #endif @@ -153,7 +153,7 @@ //waiting request is a receive, so it pairs to this send //First, remove the waiting receive request from the entry entry->content = waitingReq->nextReqInHashEntry; - VMS__free( waitingReq ); //Don't use contents -- so free it + VMS_PI__free( waitingReq ); //Don't use contents -- so free it if( entry->content == NULL ) { //TODO: mod hash table to double-link, so can delete entry from @@ -166,8 +166,8 @@ receivePr->dataRetFromReq = semReq->msg; //bring both processors back from suspend - resume_procr( sendPr, semEnv ); - resume_procr( receivePr, semEnv ); + resume_slaveVP( sendPr, semEnv ); + resume_slaveVP( receivePr, semEnv ); return; } @@ -179,20 +179,20 @@ //TODO: combine both send handlers into single handler void handleSendFromTo( SSRSemReq *semReq, SSRSemEnv *semEnv) - { VirtProcr *sendPr, *receivePr; + { SlaveVP *sendPr, *receivePr; int key[] = {0,0,0}; SSRSemReq *waitingReq; HashEntry *entry; HashTable *commHashTbl = semEnv->commHashTbl; - DEBUG2(dbgRqstHdlr,"SendFromTo request from processor %d to %d\n",semReq->sendPr->procrID,semReq->receivePr->procrID) + DEBUG2(dbgRqstHdlr,"SendFromTo request from processor %d to %d\n",semReq->sendPr->slaveID,semReq->receivePr->slaveID) receivePr = semReq->receivePr; //For "send", know both send & recv procrs sendPr = semReq->sendPr; - key[0] = (int)receivePr->procrID; - key[1] = (int)sendPr->procrID; + key[0] = (int)receivePr->slaveID; + key[1] = (int)sendPr->slaveID; //key[2] acts at the 0 that terminates the string entry = giveEntryElseInsertReqst( (char *)key, semReq, commHashTbl); @@ -206,18 +206,18 @@ } else { //waiting request is a receive, so it completes pair with this send - #ifdef OBSERVE_UCC + #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC Dependency newd; - newd.from_vp = sendPr->procrID; + newd.from_vp = sendPr->slaveID; newd.from_task = sendPr->numTimesScheduled; - newd.to_vp = receivePr->procrID; + newd.to_vp = receivePr->slaveID; newd.to_task = receivePr->numTimesScheduled +1; //addToListOfArraysDependency(newd,semEnv->commDependenciesList); addToListOfArrays(Dependency,newd,semEnv->commDependenciesList); #endif //First, remove the waiting receive request from the entry entry->content = waitingReq->nextReqInHashEntry; - VMS__free( waitingReq ); //Don't use contents -- so free it + VMS_PI__free( waitingReq ); //Don't use contents -- so free it //can only be one waiting req for "from-to" semantics if( entry->content != NULL ) @@ -231,8 +231,8 @@ receivePr->dataRetFromReq = semReq->msg; //bring both processors back from suspend - resume_procr( sendPr, semEnv ); - resume_procr( receivePr, semEnv ); + resume_slaveVP( sendPr, semEnv ); + resume_slaveVP( receivePr, semEnv ); return; } @@ -277,7 +277,7 @@ void handleReceiveType( SSRSemReq *semReq, SSRSemEnv *semEnv) - { VirtProcr *sendPr, *receivePr; + { SlaveVP *sendPr, *receivePr; int key[] = {0,0,0}; SSRSemReq *waitingReq; HashEntry *entry; @@ -285,9 +285,9 @@ receivePr = semReq->receivePr; - DEBUG1(dbgRqstHdlr,"ReceiveType request from processor %d\n",receivePr->procrID) + DEBUG1(dbgRqstHdlr,"ReceiveType request from processor %d\n",receivePr->slaveID) - key[0] = (int)receivePr->procrID; + key[0] = (int)receivePr->slaveID; key[1] = (int)(semReq->msgType); //key[2] acts as the 0 that terminates the string @@ -313,13 +313,13 @@ //bring both processors back from suspend sendPr = waitingReq->sendPr; - VMS__free( waitingReq ); + VMS_PI__free( waitingReq ); - #ifdef OBSERVE_UCC + #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC Dependency newd; - newd.from_vp = sendPr->procrID; + newd.from_vp = sendPr->slaveID; newd.from_task = sendPr->numTimesScheduled; - newd.to_vp = receivePr->procrID; + newd.to_vp = receivePr->slaveID; newd.to_task = receivePr->numTimesScheduled +1; //addToListOfArraysDependency(newd,semEnv->commDependenciesList); addToListOfArrays(Dependency,newd,semEnv->dynDependenciesList); @@ -331,16 +331,16 @@ semEnv->ntonGroups[groupId] = new_NtoN(groupId); } Unit u; - u.vp = sendPr->procrID; + u.vp = sendPr->slaveID; u.task = sendPr->numTimesScheduled; addToListOfArrays(Unit,u,semEnv->ntonGroups[groupId]->senders); - u.vp = receivePr->procrID; + u.vp = receivePr->slaveID; u.task = receivePr->numTimesScheduled +1; addToListOfArrays(Unit,u,semEnv->ntonGroups[groupId]->receivers); #endif - resume_procr( sendPr, semEnv ); - resume_procr( receivePr, semEnv ); + resume_slaveVP( sendPr, semEnv ); + resume_slaveVP( receivePr, semEnv ); return; } @@ -352,19 +352,19 @@ */ void handleReceiveFromTo( SSRSemReq *semReq, SSRSemEnv *semEnv) - { VirtProcr *sendPr, *receivePr; + { SlaveVP *sendPr, *receivePr; int key[] = {0,0,0}; SSRSemReq *waitingReq; HashEntry *entry; HashTable *commHashTbl = semEnv->commHashTbl; - DEBUG2(dbgRqstHdlr,"ReceiveFromTo request from processor %d to %d\n",semReq->sendPr->procrID,semReq->receivePr->procrID) + DEBUG2(dbgRqstHdlr,"ReceiveFromTo request from processor %d to %d\n",semReq->sendPr->slaveID,semReq->receivePr->slaveID) receivePr = semReq->receivePr; sendPr = semReq->sendPr; //for receive from-to, know send procr - key[0] = (int)receivePr->procrID; - key[1] = (int)sendPr->procrID; + key[0] = (int)receivePr->slaveID; + key[1] = (int)sendPr->slaveID; //key[2] acts at the 0 that terminates the string entry = giveEntryElseInsertReqst( (char *)key, semReq, commHashTbl); @@ -375,11 +375,11 @@ //At this point, know have waiting request(s) -- should be send(s) if( waitingReq->reqType == send_from_to ) { //waiting request is a send, so pair it with this receive - #ifdef OBSERVE_UCC + #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC Dependency newd; - newd.from_vp = sendPr->procrID; + newd.from_vp = sendPr->slaveID; newd.from_task = sendPr->numTimesScheduled; - newd.to_vp = receivePr->procrID; + newd.to_vp = receivePr->slaveID; newd.to_task = receivePr->numTimesScheduled +1; //addToListOfArraysDependency(newd,semEnv->commDependenciesList); addToListOfArrays(Dependency,newd,semEnv->commDependenciesList); @@ -395,10 +395,10 @@ //bring both processors back from suspend sendPr = waitingReq->sendPr; - VMS__free( waitingReq ); + VMS_PI__free( waitingReq ); - resume_procr( sendPr, semEnv ); - resume_procr( receivePr, semEnv ); + resume_slaveVP( sendPr, semEnv ); + resume_slaveVP( receivePr, semEnv ); return; } @@ -424,24 +424,24 @@ /* */ void -handleMalloc( SSRSemReq *semReq, VirtProcr *requestingPr, SSRSemEnv *semEnv ) +handleMalloc( SSRSemReq *semReq, SlaveVP *requestingPr, SSRSemEnv *semEnv ) { void *ptr; - DEBUG1(dbgRqstHdlr,"Malloc request from processor %d\n",requestingPr->procrID) + DEBUG1(dbgRqstHdlr,"Malloc request from processor %d\n",requestingPr->slaveID) - ptr = VMS__malloc( semReq->sizeToMalloc ); + ptr = VMS_PI__malloc( semReq->sizeToMalloc ); requestingPr->dataRetFromReq = ptr; - resume_procr( requestingPr, semEnv ); + resume_slaveVP( requestingPr, semEnv ); } /* */ void -handleFree( SSRSemReq *semReq, VirtProcr *requestingPr, SSRSemEnv *semEnv ) +handleFree( SSRSemReq *semReq, SlaveVP *requestingPr, SSRSemEnv *semEnv ) { - DEBUG1(dbgRqstHdlr,"Free request from processor %d\n",requestingPr->procrID) - VMS__free( semReq->ptrToFree ); - resume_procr( requestingPr, semEnv ); + DEBUG1(dbgRqstHdlr,"Free request from processor %d\n",requestingPr->slaveID) + VMS_PI__free( semReq->ptrToFree ); + resume_slaveVP( requestingPr, semEnv ); } @@ -451,13 +451,13 @@ * end-label. Else, sets flag and resumes normally. */ void inline -handleStartSingleton_helper( SSRSingleton *singleton, VirtProcr *reqstingPr, +handleStartSingleton_helper( SSRSingleton *singleton, SlaveVP *reqstingPr, SSRSemEnv *semEnv ) { if( singleton->hasFinished ) { //the code that sets the flag to true first sets the end instr addr reqstingPr->dataRetFromReq = singleton->endInstrAddr; - resume_procr( reqstingPr, semEnv ); + resume_slaveVP( reqstingPr, semEnv ); return; } else if( singleton->hasBeenStarted ) @@ -469,28 +469,28 @@ { //hasn't been started, so this is the first attempt at the singleton singleton->hasBeenStarted = TRUE; reqstingPr->dataRetFromReq = 0x0; - resume_procr( reqstingPr, semEnv ); + resume_slaveVP( reqstingPr, semEnv ); return; } } void inline -handleStartFnSingleton( SSRSemReq *semReq, VirtProcr *requestingPr, +handleStartFnSingleton( SSRSemReq *semReq, SlaveVP *requestingPr, SSRSemEnv *semEnv ) { SSRSingleton *singleton; - DEBUG1(dbgRqstHdlr,"StartFnSingleton request from processor %d\n",requestingPr->procrID) + DEBUG1(dbgRqstHdlr,"StartFnSingleton request from processor %d\n",requestingPr->slaveID) singleton = &(semEnv->fnSingletons[ semReq->singletonID ]); handleStartSingleton_helper( singleton, requestingPr, semEnv ); } void inline -handleStartDataSingleton( SSRSemReq *semReq, VirtProcr *requestingPr, +handleStartDataSingleton( SSRSemReq *semReq, SlaveVP *requestingPr, SSRSemEnv *semEnv ) { SSRSingleton *singleton; - DEBUG1(dbgRqstHdlr,"StartDataSingleton request from processor %d\n",requestingPr->procrID) + DEBUG1(dbgRqstHdlr,"StartDataSingleton request from processor %d\n",requestingPr->slaveID) if( *(semReq->singletonPtrAddr) == NULL ) - { singleton = VMS__malloc( sizeof(SSRSingleton) ); - singleton->waitQ = makeVMSPrivQ(); + { singleton = VMS_PI__malloc( sizeof(SSRSingleton) ); + singleton->waitQ = makeVMSQ(); singleton->endInstrAddr = 0x0; singleton->hasBeenStarted = FALSE; singleton->hasFinished = FALSE; @@ -503,16 +503,16 @@ void inline -handleEndSingleton_helper( SSRSingleton *singleton, VirtProcr *requestingPr, +handleEndSingleton_helper( SSRSingleton *singleton, SlaveVP *requestingPr, SSRSemEnv *semEnv ) { PrivQueueStruc *waitQ; int32 numWaiting, i; - VirtProcr *resumingPr; + SlaveVP *resumingPr; if( singleton->hasFinished ) { //by definition, only one slave should ever be able to run end singleton // so if this is true, is an error - //VMS__throw_exception( "singleton code ran twice", requestingPr, NULL); + //VMS_PI__throw_exception( "singleton code ran twice", requestingPr, NULL); } singleton->hasFinished = TRUE; @@ -522,30 +522,30 @@ { //they will resume inside start singleton, then jmp to end singleton resumingPr = readPrivQ( waitQ ); resumingPr->dataRetFromReq = singleton->endInstrAddr; - resume_procr( resumingPr, semEnv ); + resume_slaveVP( resumingPr, semEnv ); } - resume_procr( requestingPr, semEnv ); + resume_slaveVP( requestingPr, semEnv ); } void inline -handleEndFnSingleton( SSRSemReq *semReq, VirtProcr *requestingPr, +handleEndFnSingleton( SSRSemReq *semReq, SlaveVP *requestingPr, SSRSemEnv *semEnv ) { SSRSingleton *singleton; - DEBUG1(dbgRqstHdlr,"EndFnSingleton request from processor %d\n",requestingPr->procrID) + DEBUG1(dbgRqstHdlr,"EndFnSingleton request from processor %d\n",requestingPr->slaveID) singleton = &(semEnv->fnSingletons[ semReq->singletonID ]); handleEndSingleton_helper( singleton, requestingPr, semEnv ); } void inline -handleEndDataSingleton( SSRSemReq *semReq, VirtProcr *requestingPr, +handleEndDataSingleton( SSRSemReq *semReq, SlaveVP *requestingPr, SSRSemEnv *semEnv ) { SSRSingleton *singleton; - DEBUG1(dbgRqstHdlr,"EndDataSingleton request from processor %d\n",requestingPr->procrID) + DEBUG1(dbgRqstHdlr,"EndDataSingleton request from processor %d\n",requestingPr->slaveID) singleton = *(semReq->singletonPtrAddr); handleEndSingleton_helper( singleton, requestingPr, semEnv ); @@ -556,11 +556,11 @@ * pointer out of the request and call it, then resume the VP. */ void -handleAtomic( SSRSemReq *semReq, VirtProcr *requestingPr, SSRSemEnv *semEnv ) +handleAtomic( SSRSemReq *semReq, SlaveVP *requestingPr, SSRSemEnv *semEnv ) { - DEBUG1(dbgRqstHdlr,"Atomic request from processor %d\n",requestingPr->procrID) + DEBUG1(dbgRqstHdlr,"Atomic request from processor %d\n",requestingPr->slaveID) semReq->fnToExecInMaster( semReq->dataForFn ); - resume_procr( requestingPr, semEnv ); + resume_slaveVP( requestingPr, semEnv ); } /*First, it looks at the VP's semantic data, to see the highest transactionID @@ -578,23 +578,23 @@ *If NULL, then write requesting into the field and resume. */ void -handleTransStart( SSRSemReq *semReq, VirtProcr *requestingPr, +handleTransStart( SSRSemReq *semReq, SlaveVP *requestingPr, SSRSemEnv *semEnv ) { SSRSemData *semData; TransListElem *nextTransElem; - DEBUG1(dbgRqstHdlr,"TransStart request from processor %d\n",requestingPr->procrID) + DEBUG1(dbgRqstHdlr,"TransStart request from processor %d\n",requestingPr->slaveID) //check ordering of entering transactions is correct semData = requestingPr->semanticData; if( semData->highestTransEntered > semReq->transID ) { //throw VMS exception, which shuts down VMS. - VMS__throw_exception( "transID smaller than prev", requestingPr, NULL); + VMS_PI__throw_exception( "transID smaller than prev", requestingPr, NULL); } //add this trans ID to the list of transactions entered -- check when // end a transaction semData->highestTransEntered = semReq->transID; - nextTransElem = VMS__malloc( sizeof(TransListElem) ); + nextTransElem = VMS_PI__malloc( sizeof(TransListElem) ); nextTransElem->transID = semReq->transID; nextTransElem->nextTrans = semData->lastTransEntered; semData->lastTransEntered = nextTransElem; @@ -606,7 +606,7 @@ if( transStruc->VPCurrentlyExecuting == NULL ) { transStruc->VPCurrentlyExecuting = requestingPr; - resume_procr( requestingPr, semEnv ); + resume_slaveVP( requestingPr, semEnv ); } else { //note, might make future things cleaner if save request with VP and @@ -631,20 +631,20 @@ * resume both. */ void -handleTransEnd(SSRSemReq *semReq, VirtProcr *requestingPr, SSRSemEnv *semEnv) +handleTransEnd(SSRSemReq *semReq, SlaveVP *requestingPr, SSRSemEnv *semEnv) { SSRSemData *semData; - VirtProcr *waitingPr; + SlaveVP *waitingPr; SSRTrans *transStruc; TransListElem *lastTrans; - DEBUG1(dbgRqstHdlr,"TransEnd request from processor %d\n",requestingPr->procrID) + DEBUG1(dbgRqstHdlr,"TransEnd request from processor %d\n",requestingPr->slaveID) transStruc = &(semEnv->transactionStrucs[ semReq->transID ]); //make sure transaction ended in same VP as started it. if( transStruc->VPCurrentlyExecuting != requestingPr ) { - VMS__throw_exception( "trans ended in diff VP", requestingPr, NULL ); + VMS_PI__throw_exception( "trans ended in diff VP", requestingPr, NULL ); } //make sure nesting is correct -- last ID entered should == this ID @@ -652,7 +652,7 @@ lastTrans = semData->lastTransEntered; if( lastTrans->transID != semReq->transID ) { - VMS__throw_exception( "trans incorrectly nested", requestingPr, NULL ); + VMS_PI__throw_exception( "trans incorrectly nested", requestingPr, NULL ); } semData->lastTransEntered = semData->lastTransEntered->nextTrans; @@ -662,7 +662,7 @@ transStruc->VPCurrentlyExecuting = waitingPr; if( waitingPr != NULL ) - resume_procr( waitingPr, semEnv ); + resume_slaveVP( waitingPr, semEnv ); - resume_procr( requestingPr, semEnv ); + resume_slaveVP( requestingPr, semEnv ); } diff -r 471c89d1d545 -r 3c9ed64db705 SSR_Request_Handlers.h --- a/SSR_Request_Handlers.h Fri Mar 09 19:01:21 2012 +0100 +++ b/SSR_Request_Handlers.h Fri Mar 09 22:28:08 2012 -0800 @@ -29,27 +29,27 @@ inline void handleTransferOut( SSRSemReq *semReq, SSRSemEnv *semEnv); inline void -handleMalloc( SSRSemReq *semReq, VirtProcr *requestingPr, SSRSemEnv *semEnv); +handleMalloc( SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv *semEnv); inline void -handleFree( SSRSemReq *semReq, VirtProcr *requestingPr, SSRSemEnv *semEnv ); +handleFree( SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv *semEnv ); inline void -handleTransEnd(SSRSemReq *semReq, VirtProcr *requestingPr, SSRSemEnv*semEnv); +handleTransEnd(SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv*semEnv); inline void -handleTransStart( SSRSemReq *semReq, VirtProcr *requestingPr, +handleTransStart( SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv *semEnv ); inline void -handleAtomic( SSRSemReq *semReq, VirtProcr *requestingPr, SSRSemEnv *semEnv); +handleAtomic( SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv *semEnv); inline void -handleStartFnSingleton( SSRSemReq *semReq, VirtProcr *reqstingPr, +handleStartFnSingleton( SSRSemReq *semReq, SlaveVP *reqstingSlv, SSRSemEnv *semEnv ); inline void -handleEndFnSingleton( SSRSemReq *semReq, VirtProcr *requestingPr, +handleEndFnSingleton( SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv *semEnv ); inline void -handleStartDataSingleton( SSRSemReq *semReq, VirtProcr *reqstingPr, +handleStartDataSingleton( SSRSemReq *semReq, SlaveVP *reqstingSlv, SSRSemEnv *semEnv ); inline void -handleEndDataSingleton( SSRSemReq *semReq, VirtProcr *requestingPr, +handleEndDataSingleton( SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv *semEnv ); #endif /* _SSR_REQ_H */ diff -r 471c89d1d545 -r 3c9ed64db705 SSR_lib.c --- a/SSR_lib.c Fri Mar 09 19:01:21 2012 +0100 +++ b/SSR_lib.c Fri Mar 09 22:28:08 2012 -0800 @@ -91,11 +91,11 @@ * any of the data reachable from initData passed in to here */ void -SSR__create_seed_procr_and_do_work( VirtProcrFnPtr fnPtr, void *initData ) +SSR__create_seed_procr_and_do_work( TopLevelFnPtr fnPtr, void *initData ) { SSRSemEnv *semEnv; - VirtProcr *seedPr; + SlaveVP *seedPr; - #ifdef SEQUENTIAL + #ifdef DEBUG__TURN_ON_SEQUENTIAL_MODE SSR__init_Seq(); //debug sequential exe #else SSR__init(); //normal multi-thd @@ -107,12 +107,12 @@ seedPr = SSR__create_procr_helper( fnPtr, initData, semEnv, semEnv->nextCoreToGetNewPr++ ); - resume_procr( seedPr, semEnv ); + resume_slaveVP( seedPr, semEnv ); - #ifdef SEQUENTIAL - VMS__start_the_work_then_wait_until_done_Seq(); //debug sequential exe + #ifdef DEBUG__TURN_ON_SEQUENTIAL_MODE + VMS_SS__start_the_work_then_wait_until_done_Seq(); //debug sequential exe #else - VMS__start_the_work_then_wait_until_done(); //normal multi-thd + VMS_SS__start_the_work_then_wait_until_done(); //normal multi-thd #endif SSR__cleanup_after_shutdown(); @@ -175,18 +175,18 @@ void SSR__init() { - VMS__init(); + VMS_SS__init(); //masterEnv, a global var, now is partially set up by init_VMS - // after this, have VMS__malloc and VMS__free available + // after this, have VMS_int__malloc and VMS_int__free available SSR__init_Helper(); } -#ifdef SEQUENTIAL +#ifdef DEBUG__TURN_ON_SEQUENTIAL_MODE void SSR__init_Seq() { - VMS__init_Seq(); + VMS_SS__init_Seq(); flushRegisters(); //masterEnv, a global var, now is partially set up by init_VMS @@ -194,9 +194,9 @@ } #endif -void idle_fn(void* data, VirtProcr *animatingPr){ +void idle_fn(void* data, SlaveVP *animatingSlv){ while(1){ - VMS__suspend_procr(animatingPr); + VMS_int__suspend_slaveVP_and_send_req(animatingSlv); } } @@ -208,27 +208,27 @@ //Hook up the semantic layer's plug-ins to the Master virt procr _VMSMasterEnv->requestHandler = &SSR__Request_Handler; - _VMSMasterEnv->slaveScheduler = &SSR__schedule_virt_procr; - #ifdef MEAS__PERF_COUNTERS + _VMSMasterEnv->slaveAssigner = &SSR__schedule_slaveVP; + #ifdef HOLISTIC__TURN_ON_PERF_COUNTERS _VMSMasterEnv->counterHandler = &SSR__counter_handler; #endif //create the semantic layer's environment (all its data) and add to // the master environment - semanticEnv = VMS__malloc( sizeof( SSRSemEnv ) ); + semanticEnv = VMS_int__malloc( sizeof( SSRSemEnv ) ); _VMSMasterEnv->semanticEnv = semanticEnv; - #ifdef MEAS__PERF_COUNTERS + #ifdef HOLISTIC__TURN_ON_PERF_COUNTERS SSR__init_counter_data_structs(); #endif for(i=0;iidlePr[i][j] = VMS__create_procr(&idle_fn,NULL); + semanticEnv->idlePr[i][j] = VMS_int__create_slaveVP(&idle_fn,NULL); semanticEnv->idlePr[i][j]->coreAnimatedBy = i; } } - #ifdef OBSERVE_UCC + #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC semanticEnv->unitList = makeListOfArrays(sizeof(Unit),128); semanticEnv->ctlDependenciesList = makeListOfArrays(sizeof(Dependency),128); semanticEnv->commDependenciesList = makeListOfArrays(sizeof(Dependency),128); @@ -243,19 +243,19 @@ // and so forth //TODO: add hash tables for pairing sends with receives, and // initialize the data ownership system - readyVPQs = VMS__malloc( NUM_CORES * sizeof(PrivQueueStruc *) ); + readyVPQs = VMS_int__malloc( NUM_CORES * sizeof(PrivQueueStruc *) ); for( coreIdx = 0; coreIdx < NUM_CORES; coreIdx++ ) { - readyVPQs[ coreIdx ] = makeVMSPrivQ(); + readyVPQs[ coreIdx ] = makeVMSQ(); } semanticEnv->readyVPQs = readyVPQs; semanticEnv->nextCoreToGetNewPr = 0; - semanticEnv->numVirtPr = 0; + semanticEnv->numSlaveVP = 0; - semanticEnv->commHashTbl = makeHashTable( 1<<16, &VMS__free );//start big + semanticEnv->commHashTbl = makeHashTable( 1<<16, &VMS_int__free );//start big //TODO: bug -- turn these arrays into dyn arrays to eliminate limit //semanticEnv->singletonHasBeenExecutedFlags = makeDynArrayInfo( ); @@ -265,13 +265,13 @@ semanticEnv->fnSingletons[i].endInstrAddr = NULL; semanticEnv->fnSingletons[i].hasBeenStarted = FALSE; semanticEnv->fnSingletons[i].hasFinished = FALSE; - semanticEnv->fnSingletons[i].waitQ = makeVMSPrivQ(); - semanticEnv->transactionStrucs[i].waitingVPQ = makeVMSPrivQ(); + semanticEnv->fnSingletons[i].waitQ = makeVMSQ(); + semanticEnv->transactionStrucs[i].waitingVPQ = makeVMSQ(); } } -/*Frees any memory allocated by SSR__init() then calls VMS__shutdown +/*Frees any memory allocated by SSR__init() then calls VMS_int__shutdown */ void SSR__cleanup_after_shutdown() @@ -279,7 +279,7 @@ semanticEnv = _VMSMasterEnv->semanticEnv; - #ifdef OBSERVE_UCC + #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC //UCC FILE* output; int n; @@ -358,7 +358,7 @@ freeListOfArrays(semanticEnv->dynDependenciesList); #endif -#ifdef MEAS__PERF_COUNTERS +#ifdef HOLISTIC__TURN_ON_PERF_COUNTERS for(n=0;n<255;n++) { sprintf(filename, "./counters/Counters.%d.csv",n); @@ -394,15 +394,15 @@ for( coreIdx = 0; coreIdx < NUM_CORES; coreIdx++ ) { - VMS__free( semanticEnv->readyVPQs[coreIdx]->startOfData ); - VMS__free( semanticEnv->readyVPQs[coreIdx] ); + VMS_int__free( semanticEnv->readyVPQs[coreIdx]->startOfData ); + VMS_int__free( semanticEnv->readyVPQs[coreIdx] ); } - VMS__free( semanticEnv->readyVPQs ); + VMS_int__free( semanticEnv->readyVPQs ); freeHashTable( semanticEnv->commHashTbl ); - VMS__free( _VMSMasterEnv->semanticEnv ); + VMS_int__free( _VMSMasterEnv->semanticEnv ); */ - VMS__cleanup_at_end_of_shutdown(); + VMS_SS__cleanup_at_end_of_shutdown(); } @@ -410,9 +410,9 @@ /* */ - VirtProcr * -SSR__create_procr_with( VirtProcrFnPtr fnPtr, void *initData, - VirtProcr *creatingPr ) + SlaveVP * +SSR__create_procr_with( TopLevelFnPtr fnPtr, void *initData, + SlaveVP *creatingPr ) { SSRSemReq reqData; //the semantic request data is on the stack and disappears when this @@ -424,14 +424,14 @@ reqData.initData = initData; reqData.sendPr = creatingPr; - VMS__send_create_procr_req( &reqData, creatingPr ); + VMS_WL__send_create_slaveVP_req( &reqData, creatingPr ); return creatingPr->dataRetFromReq; } - VirtProcr * -SSR__create_procr_with_affinity( VirtProcrFnPtr fnPtr, void *initData, - VirtProcr *creatingPr, int32 coreToScheduleOnto ) + SlaveVP * +SSR__create_procr_with_affinity( TopLevelFnPtr fnPtr, void *initData, + SlaveVP *creatingPr, int32 coreToScheduleOnto ) { SSRSemReq reqData; //the semantic request data is on the stack and disappears when this @@ -443,30 +443,30 @@ reqData.initData = initData; reqData.sendPr = creatingPr; - VMS__send_create_procr_req( &reqData, creatingPr ); + VMS_WL__send_create_slaveVP_req( &reqData, creatingPr ); return creatingPr->dataRetFromReq; } void -SSR__dissipate_procr( VirtProcr *procrToDissipate ) +SSR__dissipate_procr( SlaveVP *procrToDissipate ) { - VMS__send_dissipate_req( procrToDissipate ); + VMS_WL__send_dissipate_req( procrToDissipate ); } //=========================================================================== void * -SSR__malloc_to( int32 sizeToMalloc, VirtProcr *owningPr ) +SSR__malloc_to( int32 sizeToMalloc, SlaveVP *owningPr ) { SSRSemReq reqData; reqData.reqType = malloc_req; reqData.sendPr = owningPr; reqData.sizeToMalloc = sizeToMalloc; - VMS__send_sem_request( &reqData, owningPr ); + VMS_WL__send_sem_request( &reqData, owningPr ); return owningPr->dataRetFromReq; } @@ -475,20 +475,20 @@ /*Sends request to Master, which does the work of freeing */ void -SSR__free( void *ptrToFree, VirtProcr *owningPr ) +SSR__free( void *ptrToFree, SlaveVP *owningPr ) { SSRSemReq reqData; reqData.reqType = free_req; reqData.sendPr = owningPr; reqData.ptrToFree = ptrToFree; - VMS__send_sem_request( &reqData, owningPr ); + VMS_WL__send_sem_request( &reqData, owningPr ); } void -SSR__transfer_ownership_of_from_to( void *data, VirtProcr *oldOwnerPr, - VirtProcr *newOwnerPr ) +SSR__transfer_ownership_of_from_to( void *data, SlaveVP *oldOwnerSlv, + SlaveVP *newOwnerPr ) { //TODO: put in the ownership system that automatically frees when no // owners of data left -- will need keeper for keeping data around when @@ -497,14 +497,14 @@ void -SSR__add_ownership_by_to( VirtProcr *newOwnerPr, void *data ) +SSR__add_ownership_by_to( SlaveVP *newOwnerSlv, void *data ) { } void -SSR__remove_ownership_by_from( VirtProcr *loserPr, void *dataLosing ) +SSR__remove_ownership_by_from( SlaveVP *loserSlv, void *dataLosing ) { } @@ -536,8 +536,8 @@ //=========================================================================== void -SSR__send_of_type_to( VirtProcr *sendPr, void *msg, const int type, - VirtProcr *receivePr) +SSR__send_of_type_to( SlaveVP *sendPr, void *msg, const int type, + SlaveVP *receivePr) { SSRSemReq reqData; reqData.receivePr = receivePr; @@ -551,14 +551,14 @@ // as a potential in an entry in the hash table, when this receive msg // gets paired to a send, the ownership gets added to the receivePr -- // the next work-unit in the receivePr's trace will have ownership. - VMS__send_sem_request( &reqData, sendPr ); + VMS_WL__send_sem_request( &reqData, sendPr ); //When come back from suspend, no longer own data reachable from msg //TODO: release ownership here } void -SSR__send_from_to( void *msg, VirtProcr *sendPr, VirtProcr *receivePr ) +SSR__send_from_to( void *msg, SlaveVP *sendPr, SlaveVP *receivePr ) { SSRSemReq reqData; //hash on the receiver, 'cause always know it, but sometimes want to @@ -570,20 +570,20 @@ reqData.msg = msg; reqData.nextReqInHashEntry = NULL; - VMS__send_sem_request( &reqData, sendPr ); + VMS_WL__send_sem_request( &reqData, sendPr ); } //=========================================================================== void * -SSR__receive_any_to( VirtProcr *receivePr ) +SSR__receive_any_to( SlaveVP *receivePr ) { } void * -SSR__receive_type_to( const int type, VirtProcr *receivePr ) +SSR__receive_type_to( const int type, SlaveVP *receivePr ) { SSRSemReq reqData; @@ -592,7 +592,7 @@ reqData.msgType = type; reqData.nextReqInHashEntry = NULL; - VMS__send_sem_request( &reqData, receivePr ); + VMS_WL__send_sem_request( &reqData, receivePr ); return receivePr->dataRetFromReq; } @@ -606,7 +606,7 @@ * loc structure can only be modified by itself. */ void * -SSR__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr ) +SSR__receive_from_to( SlaveVP *sendPr, SlaveVP *receivePr ) { SSRSemReq reqData; //hash on the receiver, 'cause always know it, but sometimes want to @@ -617,7 +617,7 @@ reqData.reqType = receive_from_to; reqData.nextReqInHashEntry = NULL; - VMS__send_sem_request( &reqData, receivePr ); + VMS_WL__send_sem_request( &reqData, receivePr ); return receivePr->dataRetFromReq; } @@ -643,7 +643,7 @@ * semantic environment. */ void -SSR__start_fn_singleton( int32 singletonID, VirtProcr *animPr ) +SSR__start_fn_singleton( int32 singletonID, SlaveVP *animPr ) { SSRSemReq reqData; @@ -651,10 +651,10 @@ reqData.reqType = singleton_fn_start; reqData.singletonID = singletonID; - VMS__send_sem_request( &reqData, animPr ); + VMS_WL__send_sem_request( &reqData, animPr ); if( animPr->dataRetFromReq ) //will be 0 or addr of label in end singleton { - SSRSemEnv *semEnv = VMS__give_sem_env_for( animPr ); + SSRSemEnv *semEnv = VMS_int__give_sem_env_for( animPr ); asm_write_ret_from_singleton(&(semEnv->fnSingletons[ singletonID])); } } @@ -664,7 +664,7 @@ * location. */ void -SSR__start_data_singleton( SSRSingleton **singletonAddr, VirtProcr *animPr ) +SSR__start_data_singleton( SSRSingleton **singletonAddr, SlaveVP *animPr ) { SSRSemReq reqData; @@ -674,7 +674,7 @@ reqData.reqType = singleton_data_start; reqData.singletonPtrAddr = singletonAddr; - VMS__send_sem_request( &reqData, animPr ); + VMS_WL__send_sem_request( &reqData, animPr ); if( animPr->dataRetFromReq ) //either 0 or end singleton's return addr { //Assembly code changes the return addr on the stack to the one // saved into the singleton by the end-singleton-fn @@ -693,26 +693,26 @@ * inside is shared by all invocations of a given singleton ID. */ void -SSR__end_fn_singleton( int32 singletonID, VirtProcr *animPr ) +SSR__end_fn_singleton( int32 singletonID, SlaveVP *animPr ) { SSRSemReq reqData; //don't need this addr until after at least one singleton has reached // this function - SSRSemEnv *semEnv = VMS__give_sem_env_for( animPr ); + SSRSemEnv *semEnv = VMS_int__give_sem_env_for( animPr ); asm_write_ret_from_singleton(&(semEnv->fnSingletons[ singletonID])); reqData.reqType = singleton_fn_end; reqData.singletonID = singletonID; - VMS__send_sem_request( &reqData, animPr ); + VMS_WL__send_sem_request( &reqData, animPr ); EndSingletonInstrAddr: return; } void -SSR__end_data_singleton( SSRSingleton **singletonPtrAddr, VirtProcr *animPr ) +SSR__end_data_singleton( SSRSingleton **singletonPtrAddr, SlaveVP *animPr ) { SSRSemReq reqData; @@ -730,7 +730,7 @@ reqData.reqType = singleton_data_end; reqData.singletonPtrAddr = singletonPtrAddr; - VMS__send_sem_request( &reqData, animPr ); + VMS_WL__send_sem_request( &reqData, animPr ); } /*This executes the function in the masterVP, so it executes in isolation @@ -745,7 +745,7 @@ */ void SSR__animate_short_fn_in_isolation( PtrToAtomicFn ptrToFnToExecInMaster, - void *data, VirtProcr *animPr ) + void *data, SlaveVP *animPr ) { SSRSemReq reqData; @@ -754,7 +754,7 @@ reqData.fnToExecInMaster = ptrToFnToExecInMaster; reqData.dataForFn = data; - VMS__send_sem_request( &reqData, animPr ); + VMS_WL__send_sem_request( &reqData, animPr ); } @@ -772,7 +772,7 @@ *If NULL, then write requesting into the field and resume. */ void -SSR__start_transaction( int32 transactionID, VirtProcr *animPr ) +SSR__start_transaction( int32 transactionID, SlaveVP *animPr ) { SSRSemReq reqData; @@ -781,7 +781,7 @@ reqData.reqType = trans_start; reqData.transID = transactionID; - VMS__send_sem_request( &reqData, animPr ); + VMS_WL__send_sem_request( &reqData, animPr ); } /*This suspends to the master, then uses transactionID as index into an @@ -794,7 +794,7 @@ * resumes both. */ void -SSR__end_transaction( int32 transactionID, VirtProcr *animPr ) +SSR__end_transaction( int32 transactionID, SlaveVP *animPr ) { SSRSemReq reqData; @@ -803,5 +803,5 @@ reqData.reqType = trans_end; reqData.transID = transactionID; - VMS__send_sem_request( &reqData, animPr ); + VMS_WL__send_sem_request( &reqData, animPr ); } diff -r 471c89d1d545 -r 3c9ed64db705 __brch__Holistic_Model --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/__brch__Holistic_Model Fri Mar 09 22:28:08 2012 -0800 @@ -0,0 +1,4 @@ +This branch is for the project structure defined Jan 2012.. the #includes reflect this directory structure. + +More importantly, the MC_shared version of VMS requires a separat malloc implemeted by VMS code.. so this branch has modified the library to use the VMS-specific malloc. + diff -r 471c89d1d545 -r 3c9ed64db705 dependency.c --- a/dependency.c Fri Mar 09 19:01:21 2012 +0100 +++ b/dependency.c Fri Mar 09 22:28:08 2012 -0800 @@ -2,7 +2,7 @@ #include "../VMS_impl/VMS.h" Dependency* new_dependency(int from_vp, int from_task, int to_vp, int to_task){ - Dependency* newDep = (Dependency*) VMS__malloc(sizeof(Dependency)); + Dependency* newDep = (Dependency*) VMS_int__malloc(sizeof(Dependency)); if (newDep!=NULL){ newDep->from_vp = from_vp; newDep->from_task = from_task; @@ -13,7 +13,7 @@ } NtoN* new_NtoN(int id){ - NtoN* newn = (NtoN*) VMS__malloc(sizeof(NtoN)); + NtoN* newn = (NtoN*) VMS_int__malloc(sizeof(NtoN)); newn->id = id; newn->senders = makeListOfArrays(sizeof(Unit), 64); newn->receivers = makeListOfArrays(sizeof(Unit), 64); diff -r 471c89d1d545 -r 3c9ed64db705 dependency.h --- a/dependency.h Fri Mar 09 19:01:21 2012 +0100 +++ b/dependency.h Fri Mar 09 22:28:08 2012 -0800 @@ -10,7 +10,7 @@ #include -#include "../../C_Libraries/ListOfArrays/ListOfArrays.h" +#include "ListOfArrays/ListOfArrays.h" typedef struct { int vp;