VSs.DevelopConstructs History

Show minor edits - Show changes to output - Cancel

July 05, 2012, at 07:09 PM by 24.130.186.152 -
Changed lines 87-114 from:
VSs__end_transaction( int32 transactionID, SlaveVP *animSlv );
to:
VSs__end_transaction( int32 transactionID, SlaveVP *animSlv );

!!!Send-receive constructs

inline int32 *
VSs__create_taskID_of_size( int32 numInts, SlaveVP *animSlv );

void
VSs__submit_task_with_ID( VSsTaskType *taskType, void *args, int32 *taskID,
SlaveVP *animSlv);


inline int32 *
VSs__give_self_taskID( SlaveVP *animSlv );

void
VSs__send_of_type_to( void *msg, const int32 type, int32 *receiverID,
SlaveVP *senderSlv );

void
VSs__send_from_to( void *msg, int32 *senderID, int32 *receiverID, SlaveVP *senderSlv );

void *
VSs__receive_type_to( const int32 type, int32* receiverID, SlaveVP *receiverSlv );

void *
VSs__receive_from_to( int32 *senderID, int32 *receiverID, SlaveVP *receiverSlv );
July 05, 2012, at 05:57 PM by 24.130.186.152 -
Changed line 1 from:
See the VSs header file for the exact details of these constructs.
to:
!!VSs structures, types, and constructs
July 05, 2012, at 05:57 PM by 24.130.186.152 -
July 05, 2012, at 05:05 PM by 24.130.186.152 -
Deleted line 0:
Changed lines 6-184 from:
typedef void (*PtrToAtomicFn ) ( void * ); //executed atomically in master

#define IN 1
#define OUT 2
#define INOUT 2

#define READER 1
#define WRITER 2

typedef struct
{
VSsTaskFnPtr fn;
int32 numTotalArgs;//the number of inputs to function
int32 numCtldArgs;//how many of args have dependencies
int32 *argTypes; //says reader, writer, or non-ctld
int32 *argSizes; //for detecting overlap
int32 sizeOfArgs; //for memcpy of args struct
}
VSsTaskType;


typedef struct
{
bool32 hasEnabledNonFinishedWriter;
int32 numEnabledNonDoneReaders;
PrivQueueStruc *waitersQ;
}
VSsPointerEntry;

typedef struct
{
void **args; //ctld args must come first, as ptrs
VSsTaskType *taskType;
int32 numBlockingProp;
SlaveVP *slaveAssignedTo;
VSsPointerEntry **ptrEntries;
}
VSsTaskStub;

typedef struct
{
VSsTaskStub *taskStub;
int32 argNum;
int32 isReader;
}
VSsTaskStubCarrier;


typedef struct
{
int32 type;
VSsTaskStub *taskStub;
}
VSsWaiterCarrier;

/*Semantic layer-specific data sent inside a request from lib called in app
* to request handler called in AnimationMaster
*/

typedef struct
{
SlaveVP *VPCurrentlyExecuting;
PrivQueueStruc *waitingVPQ;
}
VSsTrans;

/*WARNING: assembly hard-codes position of endInstrAddr as first field
*/
typedef struct
{
void *endInstrAddr;
int32 hasBeenStarted;
int32 hasFinished;
PrivQueueStruc *waitQ;
}
VSsSingleton;

enum VSsReqType
{
submit_task = 1,
end_task,
create_slave,
create_slave_w_aff,
dissipate_slave,
//===============================
malloc_req,
free_req,
singleton_fn_start,
singleton_fn_end,
singleton_data_start,
singleton_data_end,
atomic,
trans_start,
trans_end
};

struct _VSsSemReq
{ enum VSsReqType reqType;
SlaveVP *callingSlv;
VSsTaskType *taskType;
void *args;
VSsTaskStub *taskStub;

TopLevelFnPtr fnPtr;
void *initData;
int32 coreToAssignOnto;

int32 sizeToMalloc;
void *ptrToFree;

int32 singletonID;
VSsSingleton **singletonPtrAddr;

PtrToAtomicFn fnToExecInMaster;
void *dataForFn;

int32 transID;
}
/* VSsSemReq */;


typedef struct
{
PrivQueueStruc **readyVPQs;
PrivQueueStruc *taskReadyQ; //Q: shared or local?
HashTable *argPtrHashTbl;
int32 numSlaveVP;
int32 nextCoreToGetNewSlv;
int32 primitiveStartTime;

//fix limit on num with dynArray
VSsSingleton fnSingletons[NUM_STRUCS_IN_SEM_ENV];
VSsTrans transactionStrucs[NUM_STRUCS_IN_SEM_ENV];

bool32 *coreIsDone;
int32 numCoresDone;

#ifdef HOLISTIC__TURN_ON_OBSERVE_UCC
ListOfArrays* unitList;
ListOfArrays* ctlDependenciesList;
ListOfArrays* commDependenciesList;
NtoN** ntonGroups;
PrivDynArrayInfo* ntonGroupsInfo;
ListOfArrays* dynDependenciesList;
Unit last_in_slot[NUM_CORES * NUM_ANIM_SLOTS];
ListOfArrays* hwArcs;
#endif

#ifdef HOLISTIC__TURN_ON_PERF_COUNTERS
ListOfArrays* counterList[NUM_CORES];
#endif
SlaveVP* idleSlv[NUM_CORES][NUM_ANIM_SLOTS];
int shutdownInitiated;
}
VSsSemEnv;


typedef struct _TransListElem TransListElem;
struct _TransListElem
{
int32 transID;
TransListElem *nextTrans;
};
//TransListElem

typedef struct
{
int32 highestTransEntered;
TransListElem *lastTransEntered;
bool32 needsTaskAssigned;
VSsTaskStub *taskStub;
}
VSsSemData;

//===========================================================================

void
VSs__create_seed_slave_and_do_work( TopLevelFnPtr fn, void *initData );
to:
PtrToAtomicFn is the type for functions that are executed via the VSs__animate_short_fn_in_isolation construct (below)

IN, OUT, and INOUT are used to specify the way a task uses each of its shared variables


VSsTaskType is the structure that holds information about a VSs task. One of these must be created and filled in for each kind of task created within a VSs (StarSs) program. It says how many arguments the task needs passed to it, how many of those are shared variables involved in dependencies with other tasks, the type of each, the size of each, and the size of the structure passed to the VSs__submit_task. Here is the full structure, with detailed comments on each entry:
typedef struct
{
VSsTaskFnPtr fn;
int32 numTotalArgs;//the number of inputs to function
int32 numCtldArgs;//how many of those inputs have dependencies
int32 *argTypes; //says IN, OUT, INOUT, or not involved in dependencies, for each argument (is an array)
int32 *argSizes; //size of the data structure of each argument.. used for detecting overlap (is an array)
int32 sizeOfArgs; //used when copying the array of arguments, says the size, in bytes, of the structure passed to VSs__submit_task() (below)
}
VSsTaskType;


void
VSs__create_seed_slave_and_do_work( TopLevelFnPtr fn, void *initData );


SlaveVP *
VSs__create_slave_with( TopLevelFnPtr fnPtr, void *initData,
SlaveVP *creatingSlv );

SlaveVP *
VSs__create_slave_with_affinity( TopLevelFnPtr fnPtr, void *initData,
SlaveVP *creatingSlv, int32 coreToAssignOnto);

void
VSs__dissipate_slave( SlaveVP *slaveToDissipate );

//=======================

void *
VSs__malloc( int32 numBytes, SlaveVP *callingSlave )

VSs__free( void *ptrToFree, SlaveVP *callingSlave )

//=======================
Changed lines 48-49 from:
VSs__giveMinWorkUnitCycles( float32 percentOverhead );
to:
VSs__submit_task( VSsTaskType *taskType, void *args, SlaveVP *animSlv);
Changed lines 52-64 from:
VSs__start_primitive();

int32
VSs__end_primitive_and_give_cycles();

int32
VSs__giveIdealNumWorkUnits();

int32
VSs__give_number_of_cores_to_schedule_onto();

//=======================
to:
VSs__end_task( SlaveVP *animSlv );



//======================= Concurrency Stuff ======================
Changed lines 58-59 from:
VSs__init();
to:
VSs__start_fn_singleton( int32 singletonID, SlaveVP *animSlv );
Changed lines 61-72 from:
VSs__cleanup_after_shutdown();

//=======================

SlaveVP *
VSs__create_slave_with( TopLevelFnPtr fnPtr, void *initData,
SlaveVP *creatingSlv );

SlaveVP *
VSs__create_slave_with_affinity( TopLevelFnPtr fnPtr, void *initData,
SlaveVP *creatingSlv, int32 coreToAssignOnto
);
to:
VSs__end_fn_singleton( int32 singletonID, SlaveVP *animSlv );
Changed lines 64-76 from:
VSs__dissipate_slave( SlaveVP *slaveToDissipate );

//=======================

VSs__malloc( numBytes, callingSlave )

VSs__free(ptrToFree, callingSlave )

//=======================
int32
VSs__submit_task( VSsTaskType *taskType, void *args, SlaveVP *animSlv);
to:
VSs__start_data_singleton( VSsSingleton **singeltonAddr, SlaveVP *animSlv );
Changed lines 67-71 from:
VSs__end_task( SlaveVP *animSlv );



//======================= Concurrency Stuff ======================
to:
VSs__end_data_singleton( VSsSingleton **singletonAddr, SlaveVP *animSlv );
Changed lines 70-71 from:
VSs__start_fn_singleton( int32 singletonID, SlaveVP *animSlv );
to:
VSs__animate_short_fn_in_isolation( PtrToAtomicFn ptrToFnToExecInMaster,
void *data
, SlaveVP *animSlv );
Changed lines 74-75 from:
VSs__end_fn_singleton( int32 singletonID, SlaveVP *animSlv );
to:
VSs__start_transaction( int32 transactionID, SlaveVP *animSlv );
Changed lines 77-90 from:
VSs__start_data_singleton( VSsSingleton **singeltonAddr, SlaveVP *animSlv );

void
VSs__end_data_singleton( VSsSingleton **singletonAddr, SlaveVP *animSlv );

void
VSs__animate_short_fn_in_isolation( PtrToAtomicFn ptrToFnToExecInMaster,
void *data, SlaveVP *animSlv );

void
VSs__start_transaction( int32 transactionID, SlaveVP *animSlv );

void

VSs__end_transaction( int32 transactionID, SlaveVP *animSlv );
to:
VSs__end_transaction( int32 transactionID, SlaveVP *animSlv );
July 05, 2012, at 04:44 PM by 24.130.186.152 -
Added lines 1-259:

See the VSs header file for the exact details of these constructs.

!!!Types and structs

VSsTaskFnPtr is the type for variables that hold a pointer to a function that encodes the behavior of a task. Such functions have a fixed signature.
typedef void (*PtrToAtomicFn ) ( void * ); //executed atomically in master

#define IN 1
#define OUT 2
#define INOUT 2

#define READER 1
#define WRITER 2

typedef struct
{
VSsTaskFnPtr fn;
int32 numTotalArgs;//the number of inputs to function
int32 numCtldArgs;//how many of args have dependencies
int32 *argTypes; //says reader, writer, or non-ctld
int32 *argSizes; //for detecting overlap
int32 sizeOfArgs; //for memcpy of args struct
}
VSsTaskType;


typedef struct
{
bool32 hasEnabledNonFinishedWriter;
int32 numEnabledNonDoneReaders;
PrivQueueStruc *waitersQ;
}
VSsPointerEntry;

typedef struct
{
void **args; //ctld args must come first, as ptrs
VSsTaskType *taskType;
int32 numBlockingProp;
SlaveVP *slaveAssignedTo;
VSsPointerEntry **ptrEntries;
}
VSsTaskStub;

typedef struct
{
VSsTaskStub *taskStub;
int32 argNum;
int32 isReader;
}
VSsTaskStubCarrier;


typedef struct
{
int32 type;
VSsTaskStub *taskStub;
}
VSsWaiterCarrier;

/*Semantic layer-specific data sent inside a request from lib called in app
* to request handler called in AnimationMaster
*/

typedef struct
{
SlaveVP *VPCurrentlyExecuting;
PrivQueueStruc *waitingVPQ;
}
VSsTrans;

/*WARNING: assembly hard-codes position of endInstrAddr as first field
*/
typedef struct
{
void *endInstrAddr;
int32 hasBeenStarted;
int32 hasFinished;
PrivQueueStruc *waitQ;
}
VSsSingleton;

enum VSsReqType
{
submit_task = 1,
end_task,
create_slave,
create_slave_w_aff,
dissipate_slave,
//===============================
malloc_req,
free_req,
singleton_fn_start,
singleton_fn_end,
singleton_data_start,
singleton_data_end,
atomic,
trans_start,
trans_end
};

struct _VSsSemReq
{ enum VSsReqType reqType;
SlaveVP *callingSlv;
VSsTaskType *taskType;
void *args;
VSsTaskStub *taskStub;

TopLevelFnPtr fnPtr;
void *initData;
int32 coreToAssignOnto;

int32 sizeToMalloc;
void *ptrToFree;

int32 singletonID;
VSsSingleton **singletonPtrAddr;

PtrToAtomicFn fnToExecInMaster;
void *dataForFn;

int32 transID;
}
/* VSsSemReq */;


typedef struct
{
PrivQueueStruc **readyVPQs;
PrivQueueStruc *taskReadyQ; //Q: shared or local?
HashTable *argPtrHashTbl;
int32 numSlaveVP;
int32 nextCoreToGetNewSlv;
int32 primitiveStartTime;

//fix limit on num with dynArray
VSsSingleton fnSingletons[NUM_STRUCS_IN_SEM_ENV];
VSsTrans transactionStrucs[NUM_STRUCS_IN_SEM_ENV];

bool32 *coreIsDone;
int32 numCoresDone;

#ifdef HOLISTIC__TURN_ON_OBSERVE_UCC
ListOfArrays* unitList;
ListOfArrays* ctlDependenciesList;
ListOfArrays* commDependenciesList;
NtoN** ntonGroups;
PrivDynArrayInfo* ntonGroupsInfo;
ListOfArrays* dynDependenciesList;
Unit last_in_slot[NUM_CORES * NUM_ANIM_SLOTS];
ListOfArrays* hwArcs;
#endif

#ifdef HOLISTIC__TURN_ON_PERF_COUNTERS
ListOfArrays* counterList[NUM_CORES];
#endif
SlaveVP* idleSlv[NUM_CORES][NUM_ANIM_SLOTS];
int shutdownInitiated;
}
VSsSemEnv;


typedef struct _TransListElem TransListElem;
struct _TransListElem
{
int32 transID;
TransListElem *nextTrans;
};
//TransListElem

typedef struct
{
int32 highestTransEntered;
TransListElem *lastTransEntered;
bool32 needsTaskAssigned;
VSsTaskStub *taskStub;
}
VSsSemData;

//===========================================================================

void
VSs__create_seed_slave_and_do_work( TopLevelFnPtr fn, void *initData );

int32
VSs__giveMinWorkUnitCycles( float32 percentOverhead );

void
VSs__start_primitive();

int32
VSs__end_primitive_and_give_cycles();

int32
VSs__giveIdealNumWorkUnits();

int32
VSs__give_number_of_cores_to_schedule_onto();

//=======================

void
VSs__init();

void
VSs__cleanup_after_shutdown();

//=======================

SlaveVP *
VSs__create_slave_with( TopLevelFnPtr fnPtr, void *initData,
SlaveVP *creatingSlv );

SlaveVP *
VSs__create_slave_with_affinity( TopLevelFnPtr fnPtr, void *initData,
SlaveVP *creatingSlv, int32 coreToAssignOnto);

void
VSs__dissipate_slave( SlaveVP *slaveToDissipate );

//=======================

VSs__malloc( numBytes, callingSlave )

VSs__free(ptrToFree, callingSlave )

//=======================
int32
VSs__submit_task( VSsTaskType *taskType, void *args, SlaveVP *animSlv);


void
VSs__end_task( SlaveVP *animSlv );



//======================= Concurrency Stuff ======================
void
VSs__start_fn_singleton( int32 singletonID, SlaveVP *animSlv );

void
VSs__end_fn_singleton( int32 singletonID, SlaveVP *animSlv );

void
VSs__start_data_singleton( VSsSingleton **singeltonAddr, SlaveVP *animSlv );

void
VSs__end_data_singleton( VSsSingleton **singletonAddr, SlaveVP *animSlv );

void
VSs__animate_short_fn_in_isolation( PtrToAtomicFn ptrToFnToExecInMaster,
void *data, SlaveVP *animSlv );

void
VSs__start_transaction( int32 transactionID, SlaveVP *animSlv );

void
VSs__end_transaction( int32 transactionID, SlaveVP *animSlv );