# HG changeset patch # User Nina Engelhardt # Date 1370436040 -7200 # Node ID 37bb39da5ff1fa3b7e755ae64843717212541ddb # Parent df464a215387e4e1a3e764a45a0fc46e700b1cda static3d working, still trouble with child tasks diff -r df464a215387 -r 37bb39da5ff1 VSs.h --- a/VSs.h Mon Jun 03 18:49:19 2013 +0200 +++ b/VSs.h Wed Jun 05 14:40:40 2013 +0200 @@ -14,7 +14,7 @@ #include "VMS_impl/VMS.h" #include "Measurement/dependency.h" -void free_pointer_entry(void* ptrEntry); +extern void free_pointer_entry(void* ptrEntry); /* Switch for Nexus support * Note: nexus incompatible with holistic recording (constraints not accessible) * But counter recording still functional, can build constraintless display @@ -26,7 +26,7 @@ //=========================================================================== #define NUM_STRUCS_IN_SEM_ENV 1000 -#define MAX_TASKS_NUM 256 +#define MAX_TASKS_NUM 5 //This is hardware dependent -- it's the number of cycles of scheduling // overhead -- if a work unit is fewer than this, it is better being diff -r df464a215387 -r 37bb39da5ff1 VSs_Request_Handlers.c --- a/VSs_Request_Handlers.c Mon Jun 03 18:49:19 2013 +0200 +++ b/VSs_Request_Handlers.c Wed Jun 05 14:40:40 2013 +0200 @@ -500,7 +500,7 @@ endingTaskType = endingTaskStub->taskType; ptrEntries = endingTaskStub->ptrEntries; //saved in stub when create - DEBUG__printf_w_task(dbgRqstHdlr,endingTaskStub,"EndTask req from slaveID %d",semReq->callingSlv->slaveID); + DEBUG__printf_w_task(dbgSS,endingTaskStub,"EndTask req from slaveID %d",semReq->callingSlv->slaveID); //Check if parent was waiting on this task parent = (VSsTaskStub *) endingTaskStub->parentTaskStub; @@ -741,6 +741,9 @@ if (stubToFree->depsMask != NULL) { VMS_PI__free(stubToFree->depsMask); } + if (stubToFree->depsAddrs != NULL) { + VMS_PI__free(stubToFree->depsAddrs); + } if(stubToFree->taskID != NULL) { //TaskID is handed from user most of the time, not sure if overreaching (but why would you want to keep it?) VMS_PI__free(stubToFree->taskID); } @@ -1221,8 +1224,10 @@ VSsCritical* criticalSection = (VSsCritical*) malloc(sizeof(VSsCritical)); criticalSection->isOccupied = FALSE; +#ifdef HOLISTIC__TURN_ON_OBSERVE_UCC criticalSection->previous.vp = 0; criticalSection->previous.task = 0; +#endif criticalSection->waitQ = makeVMSQ(); return criticalSection; @@ -1261,7 +1266,7 @@ } } - if (criticalSection->isOccupied) { + if (!criticalSection->isOccupied) { criticalSection->isOccupied = TRUE; resume_slaveVP(requestingSlv, semEnv); } else { diff -r df464a215387 -r 37bb39da5ff1 nanos-vss.c --- a/nanos-vss.c Mon Jun 03 18:49:19 2013 +0200 +++ b/nanos-vss.c Wed Jun 05 14:40:40 2013 +0200 @@ -16,12 +16,15 @@ nanos_omp_set_interface nanos_smp_factory*/ +int tasks_created = 0; + nanos_wd_t nanos_current_wd(void) { return (nanos_wd_t) ((VSsSemData*) currVP->semanticData)->taskStub; } nanos_err_t nanos_create_wd_compact(nanos_wd_t *wd, nanos_const_wd_definition_t *const_data, nanos_wd_dyn_props_t *dyn_props, size_t data_size, void ** data, nanos_wg_t wg, nanos_copy_data_t **copies) { + VSsTaskStub* ts = (VSsTaskStub*) malloc(sizeof (VSsTaskStub)); void* alloc_data = malloc(data_size); *data = alloc_data; @@ -73,7 +76,11 @@ reqData.deps = depsAddrs; reqData.callingSlv = currVP; - reqData.taskID = NULL; + int32* taskID; + taskID = VSs__create_taskID_of_size(1); + taskID[1] = tasks_created++; + + reqData.taskID = taskID; free(ts); @@ -128,7 +135,11 @@ reqData.deps = depsAddrs; reqData.callingSlv = currVP; - reqData.taskID = NULL; + int32* taskID; + taskID = VSs__create_taskID_of_size(1); + taskID[1] = tasks_created++; + + reqData.taskID = taskID; VMS_WL__send_sem_request(&reqData, currVP);