Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
changeset 201:0320b49ca013 false_sharing
New include paths because of new project structure
| author | Merten Sach <msach@mailbox.tu-berlin.de> |
|---|---|
| date | Mon, 13 Feb 2012 19:35:32 +0100 |
| parents | a8312581709c |
| children | 37c7d1386f32 |
| files | CoreLoop.c VMS.c VMS.h VMS_defs.h probes.c probes.h vmalloc.c vmalloc.h vutilities.c vutilities.h |
| diffstat | 10 files changed, 58 insertions(+), 53 deletions(-) [+] |
line diff
1.1 --- a/CoreLoop.c Fri Feb 03 19:04:12 2012 +0100 1.2 +++ b/CoreLoop.c Mon Feb 13 19:35:32 2012 +0100 1.3 @@ -6,7 +6,7 @@ 1.4 1.5 1.6 #include "VMS.h" 1.7 -#include "Queue_impl/BlockingQueue.h" 1.8 +#include "C_Libraries/Queue_impl/BlockingQueue.h" 1.9 #include "ProcrContext.h" 1.10 1.11 #include <stdlib.h>
2.1 --- a/VMS.c Fri Feb 03 19:04:12 2012 +0100 2.2 +++ b/VMS.c Mon Feb 13 19:35:32 2012 +0100 2.3 @@ -13,8 +13,8 @@ 2.4 2.5 #include "VMS.h" 2.6 #include "ProcrContext.h" 2.7 -#include "Queue_impl/BlockingQueue.h" 2.8 -#include "Histogram/Histogram.h" 2.9 +#include "C_Libraries/Queue_impl/BlockingQueue.h" 2.10 +#include "C_Libraries/Histogram/Histogram.h" 2.11 2.12 2.13 #define thdAttrs NULL 2.14 @@ -105,7 +105,7 @@ 2.15 2.16 //Very first thing put into the master env is the free-list, seeded 2.17 // with a massive initial chunk of memory. 2.18 - //After this, all other mallocs are VMS__malloc. 2.19 + //After this, all other mallocs are VMS_int__malloc. 2.20 _VMSMasterEnv->freeLists = VMS_ext__create_free_list(); 2.21 2.22 2.23 @@ -124,15 +124,15 @@ 2.24 #endif 2.25 //======================================================================== 2.26 2.27 - //===================== Only VMS__malloc after this ==================== 2.28 + //===================== Only VMS_int__malloc after this ==================== 2.29 masterEnv = (MasterEnv*)_VMSMasterEnv; 2.30 2.31 //Make a readyToAnimateQ for each core loop 2.32 - readyToAnimateQs = VMS__malloc( NUM_CORES * sizeof(VMSQueueStruc *) ); 2.33 - masterVPs = VMS__malloc( NUM_CORES * sizeof(VirtProcr *) ); 2.34 + readyToAnimateQs = VMS_int__malloc( NUM_CORES * sizeof(VMSQueueStruc *) ); 2.35 + masterVPs = VMS_int__malloc( NUM_CORES * sizeof(VirtProcr *) ); 2.36 2.37 //One array for each core, 3 in array, core's masterVP scheds all 2.38 - allSchedSlots = VMS__malloc( NUM_CORES * sizeof(SchedSlot *) ); 2.39 + allSchedSlots = VMS_int__malloc( NUM_CORES * sizeof(SchedSlot *) ); 2.40 2.41 _VMSMasterEnv->numProcrsCreated = 0; //used by create procr 2.42 for( coreIdx = 0; coreIdx < NUM_CORES; coreIdx++ ) 2.43 @@ -162,7 +162,7 @@ 2.44 _VMSMasterEnv->dynIntervalProbesInfo = 2.45 makePrivDynArrayOfSize( (void***)&(_VMSMasterEnv->intervalProbes), 200); 2.46 2.47 - _VMSMasterEnv->probeNameHashTbl = makeHashTable( 1000, &VMS__free ); 2.48 + _VMSMasterEnv->probeNameHashTbl = makeHashTable( 1000, &VMS_int__free ); 2.49 2.50 //put creation time directly into master env, for fast retrieval 2.51 struct timeval timeStamp; 2.52 @@ -187,12 +187,12 @@ 2.53 { SchedSlot **schedSlots; 2.54 int i; 2.55 2.56 - //schedSlots = VMS__malloc( NUM_SCHED_SLOTS * sizeof(SchedSlot *) ); 2.57 + //schedSlots = VMS_int__malloc( NUM_SCHED_SLOTS * sizeof(SchedSlot *) ); 2.58 posix_memalign(&schedSlots, CACHELINE_SIZE, NUM_SCHED_SLOTS * sizeof(SchedSlot *)); 2.59 2.60 for( i = 0; i < NUM_SCHED_SLOTS; i++ ) 2.61 { 2.62 - //schedSlots[i] = VMS__malloc( sizeof(SchedSlot) ); 2.63 + //schedSlots[i] = VMS_int__malloc( sizeof(SchedSlot) ); 2.64 posix_memalign(&schedSlots[i], CACHELINE_SIZE, CACHELINE_SIZE ); 2.65 2.66 //Set state to mean "handling requests done, slot needs filling" 2.67 @@ -208,9 +208,9 @@ 2.68 { int i; 2.69 for( i = 0; i < NUM_SCHED_SLOTS; i++ ) 2.70 { 2.71 - VMS__free( schedSlots[i] ); 2.72 + VMS_int__free( schedSlots[i] ); 2.73 } 2.74 - VMS__free( schedSlots ); 2.75 + VMS_int__free( schedSlots ); 2.76 } 2.77 2.78 2.79 @@ -228,7 +228,7 @@ 2.80 2.81 //Make the threads that animate the core loops 2.82 for( coreIdx=0; coreIdx < NUM_CORES; coreIdx++ ) 2.83 - { coreLoopThdParams[coreIdx] = VMS__malloc( sizeof(ThdParams) ); 2.84 + { coreLoopThdParams[coreIdx] = VMS_int__malloc( sizeof(ThdParams) ); 2.85 coreLoopThdParams[coreIdx]->coreNum = coreIdx; 2.86 2.87 retCode = 2.88 @@ -293,7 +293,7 @@ 2.89 posix_memalign((void*)&newPr, CACHELINE_SIZE, sizeof(VirtProcr) ); //align to cacheline 2.90 posix_memalign(&stackLocs, CACHELINE_SIZE, VIRT_PROCR_STACK_SIZE ); //align to cacheline 2.91 if( stackLocs == 0 ) 2.92 - { perror("VMS__malloc stack"); exit(1); } 2.93 + { perror("VMS_int__malloc stack"); exit(1); } 2.94 2.95 return create_procr_helper( newPr, fnPtr, initialData, stackLocs ); 2.96 } 2.97 @@ -437,7 +437,7 @@ 2.98 VMS_ext__dissipate_procr( VirtProcr *procrToDissipate ) 2.99 { 2.100 //NOTE: initialData was given to the processor, so should either have 2.101 - // been alloc'd with VMS__malloc, or freed by the level above animPr. 2.102 + // been alloc'd with VMS_int__malloc, or freed by the level above animPr. 2.103 //So, all that's left to free here is the stack and the VirtProcr struc 2.104 // itself 2.105 //Note, should not stack-allocate initial data -- no guarantee, in 2.106 @@ -456,14 +456,14 @@ 2.107 * be malloc'd if this is called inside the same call chain before the 2.108 * send of the last request is called. 2.109 * 2.110 - *The request handler has to call VMS__free_VMSReq for any of these 2.111 + *The request handler has to call VMS_int__free_VMSReq for any of these 2.112 */ 2.113 inline void 2.114 VMS__add_sem_request_in_mallocd_VMSReqst( void *semReqData, 2.115 VirtProcr *callingPr ) 2.116 { VMSReqst *req; 2.117 2.118 - req = VMS__malloc( sizeof(VMSReqst) ); 2.119 + req = VMS_int__malloc( sizeof(VMSReqst) ); 2.120 req->reqType = semantic; 2.121 req->semReqData = semReqData; 2.122 req->nextReqst = callingPr->requests; 2.123 @@ -545,8 +545,8 @@ 2.124 2.125 semReq = req->semReqData; 2.126 2.127 - newProbe = VMS__malloc( sizeof(IntervalProbe) ); 2.128 - newProbe->nameStr = VMS__strDup( semReq->nameStr ); 2.129 + newProbe = VMS_int__malloc( sizeof(IntervalProbe) ); 2.130 + newProbe->nameStr = VMS_int__strDup( semReq->nameStr ); 2.131 newProbe->hist = NULL; 2.132 newProbe->schedChoiceWasRecorded = FALSE; 2.133 2.134 @@ -574,7 +574,7 @@ 2.135 * VMS_malloc mechanism. Then it calls this, which first asks the malloc 2.136 * system to disown any state that did use VMS_malloc, and then frees the 2.137 * statck and the processor-struct itself. 2.138 - *If the dissipated processor is the sole (remaining) owner of VMS__malloc'd 2.139 + *If the dissipated processor is the sole (remaining) owner of VMS_int__malloc'd 2.140 * state, then that state gets freed (or sent to recycling) as a side-effect 2.141 * of dis-owning it. 2.142 */ 2.143 @@ -583,11 +583,11 @@ 2.144 { 2.145 //dis-own all locations owned by this processor, causing to be freed 2.146 // any locations that it is (was) sole owner of 2.147 -//TODO: implement VMS__malloc system, including "give up ownership" 2.148 +//TODO: implement VMS_int__malloc system, including "give up ownership" 2.149 2.150 2.151 //NOTE: initialData was given to the processor, so should either have 2.152 - // been alloc'd with VMS__malloc, or freed by the level above animPr. 2.153 + // been alloc'd with VMS_int__malloc, or freed by the level above animPr. 2.154 //So, all that's left to free here is the stack and the VirtProcr struc 2.155 // itself 2.156 //Note, should not stack-allocate initial data -- no guarantee, in 2.157 @@ -617,7 +617,7 @@ 2.158 * masterVP any AppVPs that might still be allocated and sitting in the 2.159 * semantic environment, or have been orphaned in the _VMSWorkQ. 2.160 * 2.161 - *NOTE: the semantic plug-in is expected to use VMS__malloc to get all the 2.162 + *NOTE: the semantic plug-in is expected to use VMS_int__malloc to get all the 2.163 * locations it needs, and give ownership to masterVP. Then, they will be 2.164 * automatically freed. 2.165 * 2.166 @@ -729,7 +729,7 @@ 2.167 } 2.168 #endif 2.169 2.170 - //All the environment data has been allocated with VMS__malloc, so just 2.171 + //All the environment data has been allocated with VMS_int__malloc, so just 2.172 // free its internal big-chunk and all inside it disappear. 2.173 /* 2.174 readyToAnimateQs = _VMSMasterEnv->readyToAnimateQs; 2.175 @@ -745,13 +745,13 @@ 2.176 freeSchedSlots( allSchedSlots[ coreIdx ] ); 2.177 } 2.178 2.179 - VMS__free( _VMSMasterEnv->readyToAnimateQs ); 2.180 - VMS__free( _VMSMasterEnv->masterVPs ); 2.181 - VMS__free( _VMSMasterEnv->allSchedSlots ); 2.182 + VMS_int__free( _VMSMasterEnv->readyToAnimateQs ); 2.183 + VMS_int__free( _VMSMasterEnv->masterVPs ); 2.184 + VMS_int__free( _VMSMasterEnv->allSchedSlots ); 2.185 2.186 //============================= MEASUREMENT STUFF ======================== 2.187 #ifdef STATS__TURN_ON_PROBES 2.188 - freeDynArrayDeep( _VMSMasterEnv->dynIntervalProbesInfo, &VMS__free_probe); 2.189 + freeDynArrayDeep( _VMSMasterEnv->dynIntervalProbesInfo, &VMS_int__free_probe); 2.190 #endif 2.191 //======================================================================== 2.192 */
3.1 --- a/VMS.h Fri Feb 03 19:04:12 2012 +0100 3.2 +++ b/VMS.h Mon Feb 13 19:35:32 2012 +0100 3.3 @@ -11,10 +11,10 @@ 3.4 #define _GNU_SOURCE 3.5 3.6 #include "VMS_primitive_data_types.h" 3.7 -#include "Queue_impl/PrivateQueue.h" 3.8 -#include "Histogram/Histogram.h" 3.9 -#include "DynArray/DynArray.h" 3.10 -#include "Hash_impl/PrivateHash.h" 3.11 +#include "C_Libraries/Queue_impl/PrivateQueue.h" 3.12 +#include "C_Libraries/Histogram/Histogram.h" 3.13 +#include "C_Libraries/DynArray/DynArray.h" 3.14 +#include "C_Libraries/Hash_impl/PrivateHash.h" 3.15 #include "vmalloc.h" 3.16 3.17 #include <pthread.h> 3.18 @@ -331,6 +331,6 @@ 3.19 #include "ProcrContext.h" 3.20 #include "probes.h" 3.21 #include "vutilities.h" 3.22 -#include "../VMS_lang_specific_defines.h" 3.23 +#include "VMS_Implementations/Vthread_impl/VMS_lang_specific_defines.h" 3.24 #endif /* _VMS_H */ 3.25
4.1 --- a/VMS_defs.h Fri Feb 03 19:04:12 2012 +0100 4.2 +++ b/VMS_defs.h Mon Feb 13 19:35:32 2012 +0100 4.3 @@ -90,7 +90,7 @@ 4.4 // stack size in virtual processors created 4.5 #define VIRT_PROCR_STACK_SIZE 0x8000 /* 32K */ 4.6 4.7 - // memory for VMS__malloc 4.8 + // memory for VMS_int__malloc 4.9 #define MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE 0x40000000 /* 1G */ 4.10 4.11 #define CACHE_LINE 64 4.12 @@ -103,7 +103,7 @@ 4.13 4.14 #define writeVMSQ writePrivQ 4.15 #define readVMSQ readPrivQ 4.16 -#define makeVMSQ makeVMSPrivQ 4.17 +#define makeVMSQ makePrivQ 4.18 #define numInVMSQ numInPrivQ 4.19 #define VMSQueueStruc PrivQueueStruc 4.20
5.1 --- a/probes.c Fri Feb 03 19:04:12 2012 +0100 5.2 +++ b/probes.c Mon Feb 13 19:35:32 2012 +0100 5.3 @@ -9,8 +9,8 @@ 5.4 #include <sys/time.h> 5.5 5.6 #include "VMS.h" 5.7 -#include "Queue_impl/BlockingQueue.h" 5.8 -#include "Histogram/Histogram.h" 5.9 +#include "C_Libraries/Queue_impl/BlockingQueue.h" 5.10 +#include "C_Libraries/Histogram/Histogram.h" 5.11 5.12 5.13 //================================ STATS ==================================== 5.14 @@ -146,8 +146,8 @@ 5.15 void 5.16 VMS_impl__free_probe( IntervalProbe *probe ) 5.17 { if( probe->hist != NULL ) freeDblHist( probe->hist ); 5.18 - if( probe->nameStr != NULL) VMS__free( probe->nameStr ); 5.19 - VMS__free( probe ); 5.20 + if( probe->nameStr != NULL) VMS_int__free( probe->nameStr ); 5.21 + VMS_int__free( probe ); 5.22 } 5.23 5.24
6.1 --- a/probes.h Fri Feb 03 19:04:12 2012 +0100 6.2 +++ b/probes.h Mon Feb 13 19:35:32 2012 +0100 6.3 @@ -89,7 +89,7 @@ 6.4 binWidth, nameStr, animPr ) 6.5 void 6.6 VMS_impl__free_probe( IntervalProbe *probe ); 6.7 -#define VMS__free_probe( probe ) \ 6.8 +#define VMS_int__free_probe( probe ) \ 6.9 VMS_impl__free_probe( probe ) 6.10 6.11 void
7.1 --- a/vmalloc.c Fri Feb 03 19:04:12 2012 +0100 7.2 +++ b/vmalloc.c Mon Feb 13 19:35:32 2012 +0100 7.3 @@ -15,7 +15,7 @@ 7.4 #include <math.h> 7.5 7.6 #include "VMS.h" 7.7 -#include "Histogram/Histogram.h" 7.8 +#include "C_Libraries/Histogram/Histogram.h" 7.9 7.10 #define MAX_UINT64 0xFFFFFFFFFFFFFFFF 7.11 7.12 @@ -205,7 +205,7 @@ 7.13 * This is sequential code, meant to only be called from the Master, not from 7.14 * any slave VPs. 7.15 */ 7.16 -void *VMS__malloc( size_t sizeRequested ) 7.17 +void *VMS_int__malloc( size_t sizeRequested ) 7.18 { 7.19 //============================= MEASUREMENT STUFF ======================== 7.20 #ifdef MEAS__TIME_MALLOC 7.21 @@ -261,7 +261,7 @@ 7.22 * any slave VPs. 7.23 */ 7.24 void 7.25 -VMS__free( void *ptrToFree ) 7.26 +VMS_int__free( void *ptrToFree ) 7.27 { 7.28 7.29 //============================= MEASUREMENT STUFF ========================
8.1 --- a/vmalloc.h Fri Feb 03 19:04:12 2012 +0100 8.2 +++ b/vmalloc.h Mon Feb 13 19:35:32 2012 +0100 8.3 @@ -52,24 +52,29 @@ 8.4 } 8.5 FreeListHead; 8.6 8.7 -void * 8.8 -VMS__malloc( size_t sizeRequested ); 8.9 +//comply with interface of HW__generic_x86_64_MC branch 8.10 +#define VMS_WL__malloc VMS_int__malloc 8.11 +#define VMS_WL__malloc_aligned VMS_int__malloc_aligned 8.12 +#define VMS_WL__free VMS_int__free 8.13 8.14 void * 8.15 -VMS__malloc_aligned( size_t sizeRequested ); 8.16 +VMS_int__malloc( size_t sizeRequested ); 8.17 + 8.18 +void * 8.19 +VMS_int__malloc_aligned( size_t sizeRequested ); 8.20 8.21 void 8.22 -VMS__free( void *ptrToFree ); 8.23 +VMS_int__free( void *ptrToFree ); 8.24 8.25 /*Allocates memory from the external system -- higher overhead 8.26 */ 8.27 void * 8.28 -VMS__malloc_in_ext( size_t sizeRequested ); 8.29 +VMS_int__malloc_in_ext( size_t sizeRequested ); 8.30 8.31 /*Frees memory that was allocated in the external system -- higher overhead 8.32 */ 8.33 void 8.34 -VMS__free_in_ext( void *ptrToFree ); 8.35 +VMS_int__free_in_ext( void *ptrToFree ); 8.36 8.37 8.38 MallocArrays *
9.1 --- a/vutilities.c Fri Feb 03 19:04:12 2012 +0100 9.2 +++ b/vutilities.c Mon Feb 13 19:35:32 2012 +0100 9.3 @@ -14,10 +14,10 @@ 9.4 9.5 9.6 inline char * 9.7 -VMS__strDup( char *str ) 9.8 +VMS_int__strDup( char *str ) 9.9 { char *retStr; 9.10 9.11 - retStr = VMS__malloc( strlen(str) + 1 ); 9.12 + retStr = VMS_int__malloc( strlen(str) + 1 ); 9.13 if( str == NULL ) return str; 9.14 strcpy( retStr, str ); 9.15
