changeset 41:37bb39da5ff1 dev_expl_VP_and_DKU

static3d working, still trouble with child tasks
author Nina Engelhardt <nengel@mailbox.tu-berlin.de>
date Wed, 05 Jun 2013 14:40:40 +0200
parents df464a215387
children bb6fbcbce14d
files VSs.h VSs_Request_Handlers.c nanos-vss.c
diffstat 3 files changed, 22 insertions(+), 6 deletions(-) [+]
line diff
     1.1 --- a/VSs.h	Mon Jun 03 18:49:19 2013 +0200
     1.2 +++ b/VSs.h	Wed Jun 05 14:40:40 2013 +0200
     1.3 @@ -14,7 +14,7 @@
     1.4  #include "VMS_impl/VMS.h"
     1.5  #include "Measurement/dependency.h"
     1.6  
     1.7 -void free_pointer_entry(void* ptrEntry);
     1.8 +extern void free_pointer_entry(void* ptrEntry);
     1.9  /* Switch for Nexus support
    1.10   * Note: nexus incompatible with holistic recording (constraints not accessible)
    1.11   * But counter recording still functional, can build constraintless display
    1.12 @@ -26,7 +26,7 @@
    1.13  //===========================================================================
    1.14  #define NUM_STRUCS_IN_SEM_ENV 1000
    1.15  
    1.16 -#define MAX_TASKS_NUM 256
    1.17 +#define MAX_TASKS_NUM 5
    1.18  
    1.19     //This is hardware dependent -- it's the number of cycles of scheduling
    1.20     // overhead -- if a work unit is fewer than this, it is better being
     2.1 --- a/VSs_Request_Handlers.c	Mon Jun 03 18:49:19 2013 +0200
     2.2 +++ b/VSs_Request_Handlers.c	Wed Jun 05 14:40:40 2013 +0200
     2.3 @@ -500,7 +500,7 @@
     2.4      endingTaskType = endingTaskStub->taskType;
     2.5      ptrEntries = endingTaskStub->ptrEntries; //saved in stub when create
     2.6  
     2.7 -    DEBUG__printf_w_task(dbgRqstHdlr,endingTaskStub,"EndTask req from slaveID %d",semReq->callingSlv->slaveID);
     2.8 +    DEBUG__printf_w_task(dbgSS,endingTaskStub,"EndTask req from slaveID %d",semReq->callingSlv->slaveID);
     2.9            
    2.10      //Check if parent was waiting on this task
    2.11      parent = (VSsTaskStub *) endingTaskStub->parentTaskStub;
    2.12 @@ -741,6 +741,9 @@
    2.13      if (stubToFree->depsMask != NULL) {
    2.14          VMS_PI__free(stubToFree->depsMask);
    2.15      }
    2.16 +    if (stubToFree->depsAddrs != NULL) {
    2.17 +        VMS_PI__free(stubToFree->depsAddrs);
    2.18 +    }
    2.19      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?)
    2.20          VMS_PI__free(stubToFree->taskID);
    2.21      }
    2.22 @@ -1221,8 +1224,10 @@
    2.23      VSsCritical* criticalSection = (VSsCritical*) malloc(sizeof(VSsCritical));
    2.24      
    2.25      criticalSection->isOccupied = FALSE;
    2.26 +#ifdef HOLISTIC__TURN_ON_OBSERVE_UCC
    2.27      criticalSection->previous.vp = 0;
    2.28      criticalSection->previous.task = 0;
    2.29 +#endif
    2.30      criticalSection->waitQ = makeVMSQ();
    2.31      
    2.32      return criticalSection;
    2.33 @@ -1261,7 +1266,7 @@
    2.34              }
    2.35          }
    2.36       
    2.37 -    if (criticalSection->isOccupied) {
    2.38 +    if (!criticalSection->isOccupied) {
    2.39          criticalSection->isOccupied = TRUE;
    2.40          resume_slaveVP(requestingSlv, semEnv);
    2.41      } else {
     3.1 --- a/nanos-vss.c	Mon Jun 03 18:49:19 2013 +0200
     3.2 +++ b/nanos-vss.c	Wed Jun 05 14:40:40 2013 +0200
     3.3 @@ -16,12 +16,15 @@
     3.4  nanos_omp_set_interface
     3.5  nanos_smp_factory*/
     3.6  
     3.7 +int tasks_created = 0;
     3.8 +
     3.9  nanos_wd_t nanos_current_wd(void) {
    3.10      return (nanos_wd_t) ((VSsSemData*) currVP->semanticData)->taskStub;
    3.11  }
    3.12  
    3.13  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,
    3.14          size_t data_size, void ** data, nanos_wg_t wg, nanos_copy_data_t **copies) {
    3.15 +    
    3.16      VSsTaskStub* ts = (VSsTaskStub*) malloc(sizeof (VSsTaskStub));
    3.17      void* alloc_data = malloc(data_size);
    3.18      *data = alloc_data;
    3.19 @@ -73,7 +76,11 @@
    3.20      reqData.deps = depsAddrs;
    3.21      reqData.callingSlv = currVP;
    3.22  
    3.23 -    reqData.taskID = NULL;
    3.24 +    int32* taskID;
    3.25 +    taskID = VSs__create_taskID_of_size(1);
    3.26 +    taskID[1] = tasks_created++;
    3.27 +    
    3.28 +    reqData.taskID = taskID;
    3.29  
    3.30      free(ts);
    3.31  
    3.32 @@ -128,7 +135,11 @@
    3.33      reqData.deps = depsAddrs;
    3.34      reqData.callingSlv = currVP;
    3.35  
    3.36 -    reqData.taskID = NULL;
    3.37 +    int32* taskID;
    3.38 +    taskID = VSs__create_taskID_of_size(1);
    3.39 +    taskID[1] = tasks_created++;
    3.40 +    
    3.41 +    reqData.taskID = taskID;
    3.42  
    3.43      VMS_WL__send_sem_request(&reqData, currVP);
    3.44