Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
changeset 277:a6005210f581 Common_Ancestor
VSs working
| author | Nina Engelhardt <nengel@mailbox.tu-berlin.de> |
|---|---|
| date | Wed, 06 Mar 2013 14:32:23 +0100 |
| parents | 68212347d1d8 |
| children | 6fcf6aa5c082 |
| files | HW_Dependent_Primitives/VMS__primitives.c Services_Offered_by_VMS/Debugging/DEBUG__macros.h Services_Offered_by_VMS/Measurement_and_Stats/MEAS__macros.h Services_Offered_by_VMS/Memory_Handling/vmalloc.c VMS.h VMS__int.c VMS__startup_and_shutdown.c |
| diffstat | 7 files changed, 37 insertions(+), 9 deletions(-) [+] |
line diff
1.1 --- a/HW_Dependent_Primitives/VMS__primitives.c Fri Feb 01 17:16:39 2013 +0100 1.2 +++ b/HW_Dependent_Primitives/VMS__primitives.c Wed Mar 06 14:32:23 2013 +0100 1.3 @@ -31,7 +31,7 @@ 1.4 // Stack grows *down*, so start it at highest stack addr, minus room 1.5 // for 2 params + return addr. Do ptr arith in terms of bytes.. 1.6 stackPtr = 1.7 - (uint8 *)slaveVP->startOfStack + VIRT_PROCR_STACK_SIZE - 4*sizeof(void*); 1.8 + (uint8 *)slaveVP->startOfStack + VIRT_PROCR_STACK_SIZE - 5*sizeof(void*); 1.9 1.10 //setup __cdecl on stack 1.11 //Normally, return Addr is in loc pointed to by stackPtr, but doing a
2.1 --- a/Services_Offered_by_VMS/Debugging/DEBUG__macros.h Fri Feb 01 17:16:39 2013 +0100 2.2 +++ b/Services_Offered_by_VMS/Debugging/DEBUG__macros.h Wed Mar 06 14:32:23 2013 +0100 2.3 @@ -57,7 +57,7 @@ 2.4 { printf("Task ");\ 2.5 if(taskStub->taskID) {\ 2.6 int i;\ 2.7 - for(i=1;i<taskStub->taskID[0];i++)\ 2.8 + for(i=1;i<taskStub->taskID[0] && i < 10;i++)\ 2.9 {\ 2.10 printf("%d,",taskStub->taskID[i]);\ 2.11 }\
3.1 --- a/Services_Offered_by_VMS/Measurement_and_Stats/MEAS__macros.h Fri Feb 01 17:16:39 2013 +0100 3.2 +++ b/Services_Offered_by_VMS/Measurement_and_Stats/MEAS__macros.h Wed Mar 06 14:32:23 2013 +0100 3.3 @@ -369,7 +369,8 @@ 3.4 3.5 3.6 #define HOLISTIC__Insert_Master_Global_Vars \ 3.7 - int vpid,task; \ 3.8 + int vpid = 0; \ 3.9 + int task = 0; \ 3.10 CounterHandler counterHandler = masterEnv->counterHandler; 3.11 3.12 #define HOLISTIC__Record_last_work lastVPBeforeMaster = currVP;
4.1 --- a/Services_Offered_by_VMS/Memory_Handling/vmalloc.c Fri Feb 01 17:16:39 2013 +0100 4.2 +++ b/Services_Offered_by_VMS/Memory_Handling/vmalloc.c Wed Mar 06 14:32:23 2013 +0100 4.3 @@ -19,6 +19,11 @@ 4.4 4.5 #include "vmalloc.h" 4.6 4.7 +#define USE_SYS_MALLOC 4.8 + 4.9 +#ifdef USE_SYS_MALLOC 4.10 +#include "../malloc.h" 4.11 +#endif 4.12 4.13 #define MAX_UINT64 0xFFFFFFFFFFFFFFFF 4.14 4.15 @@ -253,6 +258,9 @@ 4.16 void * 4.17 VMS_int__malloc( size_t sizeRequested ) 4.18 { 4.19 + #ifdef USE_SYS_MALLOC 4.20 + return malloc(sizeRequested); 4.21 +#endif 4.22 MEAS__Capture_Pre_Malloc_Point 4.23 4.24 MallocArrays* freeLists = _VMSMasterEnv->freeLists; 4.25 @@ -318,7 +326,10 @@ 4.26 void 4.27 VMS_int__free( void *ptrToFree ) 4.28 { 4.29 - 4.30 + #ifdef USE_SYS_MALLOC 4.31 + free(ptrToFree); 4.32 + return; 4.33 +#endif 4.34 MEAS__Capture_Pre_Free_Point; 4.35 4.36 MallocArrays* freeLists = _VMSMasterEnv->freeLists; 4.37 @@ -383,7 +394,9 @@ 4.38 */ 4.39 void* 4.40 VMS_int__realloc(void *oldPtr, size_t sizeRequested) { 4.41 - 4.42 + #ifdef USE_SYS_MALLOC 4.43 + return realloc(oldPtr,sizeRequested); 4.44 +#endif 4.45 4.46 void* newPtr = VMS_int__malloc(sizeRequested); 4.47 4.48 @@ -415,6 +428,9 @@ 4.49 MallocArrays * 4.50 VMS_ext__create_free_list() 4.51 { 4.52 + #ifdef USE_SYS_MALLOC 4.53 + return NULL; 4.54 +#endif 4.55 //Initialize containers for small chunks and fill with zeros 4.56 _VMSMasterEnv->freeLists = (MallocArrays*)malloc( sizeof(MallocArrays) ); 4.57 MallocArrays *freeLists = _VMSMasterEnv->freeLists; 4.58 @@ -485,6 +501,9 @@ 4.59 void 4.60 VMS_ext__free_free_list( MallocArrays *freeLists ) 4.61 { 4.62 +#ifdef USE_SYS_MALLOC 4.63 + return; 4.64 +#endif 4.65 free(freeLists->memSpace); 4.66 free(freeLists->bigChunks); 4.67 free(freeLists->smallChunks);
5.1 --- a/VMS.h Fri Feb 01 17:16:39 2013 +0100 5.2 +++ b/VMS.h Wed Mar 06 14:32:23 2013 +0100 5.3 @@ -185,6 +185,7 @@ 5.4 5.5 //Initialization related 5.6 int32 setupComplete; //use while starting up coreCtlr 5.7 + int32 shutdownInitiated; 5.8 5.9 //Memory management related 5.10 MallocArrays *freeLists;
6.1 --- a/VMS__int.c Fri Feb 01 17:16:39 2013 +0100 6.2 +++ b/VMS__int.c Wed Mar 06 14:32:23 2013 +0100 6.3 @@ -33,7 +33,7 @@ 6.4 void *stackLocs; 6.5 6.6 newSlv = VMS_int__malloc( sizeof(SlaveVP) ); 6.7 - stackLocs = VMS_int__malloc( VIRT_PROCR_STACK_SIZE ); 6.8 + stackLocs = memalign(16, VIRT_PROCR_STACK_SIZE ); 6.9 if( stackLocs == 0 ) 6.10 { perror("VMS_int__malloc stack"); exit(1); } 6.11 6.12 @@ -151,10 +151,12 @@ 6.13 //dis-own all locations owned by this processor, causing to be freed 6.14 // any locations that it is (was) sole owner of 6.15 _VMSMasterEnv->numSlavesAlive -= 1; 6.16 - if( _VMSMasterEnv->numSlavesAlive == 0 ) 6.17 +/* 6.18 + if( _VMSMasterEnv->numSlavesAlive == 0 && !_VMSMasterEnv->shutdownInitiated) 6.19 { //no more work, so shutdown 6.20 VMS_SS__shutdown(); //note, creates shut-down processor on each core 6.21 } 6.22 +*/ 6.23 6.24 //NOTE: dataParam was given to the processor, so should either have 6.25 // been alloc'd with VMS_int__malloc, or freed by the level above animSlv.
7.1 --- a/VMS__startup_and_shutdown.c Fri Feb 01 17:16:39 2013 +0100 7.2 +++ b/VMS__startup_and_shutdown.c Wed Mar 06 14:32:23 2013 +0100 7.3 @@ -294,6 +294,8 @@ 7.4 allAnimSlots = VMS_int__malloc( NUM_CORES * sizeof(AnimSlot *) ); 7.5 7.6 _VMSMasterEnv->numSlavesAlive = 0; //used to detect shut-down condition 7.7 + _VMSMasterEnv->numAnimatedSlaves = 0; 7.8 + _VMSMasterEnv->shutdownInitiated = FALSE; 7.9 7.10 _VMSMasterEnv->numSlavesCreated = 0; //used by create slave to set ID 7.11 for( coreIdx = 0; coreIdx < NUM_CORES; coreIdx++ ) 7.12 @@ -343,6 +345,8 @@ 7.13 animSlots[i]->needsSlaveAssigned = TRUE; 7.14 animSlots[i]->slotIdx = i; //quick retrieval of slot pos 7.15 animSlots[i]->coreSlotIsOn = coreSlotsAreOn; 7.16 + animSlots[i]->slaveAssignedToSlot = NULL; 7.17 + animSlots[i]->perfInfo = NULL; 7.18 } 7.19 return animSlots; 7.20 } 7.21 @@ -499,6 +503,7 @@ 7.22 AnimSlot **animSlots; 7.23 //create the shutdown processors, one for each core controller -- put them 7.24 // directly into the Q -- each core will die when gets one 7.25 + _VMSMasterEnv->shutdownInitiated = TRUE; 7.26 for( coreIdx = 0; coreIdx < NUM_CORES; coreIdx++ ) 7.27 { //Note, this is running in the master 7.28 shutDownSlv = VMS_SS__create_shutdown_slave(); 7.29 @@ -562,7 +567,7 @@ 7.30 7.31 //All the environment data has been allocated with VMS__malloc, so just 7.32 // free its internal big-chunk and all inside it disappear. 7.33 -/* 7.34 + 7.35 masterVPs = _VMSMasterEnv->masterVPs; 7.36 allAnimSlots = _VMSMasterEnv->allAnimSlots; 7.37 7.38 @@ -582,7 +587,7 @@ 7.39 freeDynArrayDeep( _VMSMasterEnv->dynIntervalProbesInfo, &VMS_WL__free_probe); 7.40 #endif 7.41 //======================================================================== 7.42 -*/ 7.43 + 7.44 //These are the only two that use system free 7.45 VMS_ext__free_free_list( _VMSMasterEnv->freeLists ); 7.46 free( (void *)_VMSMasterEnv );
