Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
changeset 262:aa79134dbc88 Common_Ancestor
merge
| author | Sean Halle <seanhalle@yahoo.com> |
|---|---|
| date | Wed, 24 Oct 2012 00:00:22 -0700 |
| parents | 0dc0b8653902 f5b110414453 |
| children | 094ad1bdeaec |
| files | Services_Offered_by_VMS/Lang_Constructs/VMS_Lang.h __brch__Dev_ML |
| diffstat | 19 files changed, 162 insertions(+), 129 deletions(-) [+] |
line diff
1.1 --- a/AnimationMaster.c Mon Sep 03 03:34:54 2012 -0700 1.2 +++ b/AnimationMaster.c Wed Oct 24 00:00:22 2012 -0700 1.3 @@ -11,7 +11,8 @@ 1.4 1.5 #include "VMS.h" 1.6 1.7 - 1.8 +#include <unistd.h> 1.9 +ssize_t read(int fd, void *buf, size_t count); 1.10 1.11 /*The animationMaster embodies most of the animator of the language. The 1.12 * animator is what emodies the behavior of language constructs.
2.1 --- a/CoreController.c Mon Sep 03 03:34:54 2012 -0700 2.2 +++ b/CoreController.c Wed Oct 24 00:00:22 2012 -0700 2.3 @@ -14,13 +14,16 @@ 2.4 #include <pthread.h> 2.5 #include <sched.h> 2.6 2.7 +#include <unistd.h> 2.8 +ssize_t read(int fd, void *buf, size_t count); 2.9 + 2.10 //===================== Functions local to this file ======================= 2.11 void *terminateCoreController(SlaveVP *currSlv); 2.12 2.13 -inline void 2.14 +void 2.15 doBackoff_for_TooLongToGetLock( int32 numTriesToGetLock, uint32 *seed1, 2.16 uint32 *seed2 ); 2.17 -inline void 2.18 +void 2.19 doBackoff_for_TooLongWithNoWork( int32 numRepsWithNoWork, uint32 *seed1, 2.20 uint32 *seed2 ); 2.21 2.22 @@ -81,7 +84,9 @@ 2.23 cpu_set_t coreMask; //used during pinning pthread to CPU core 2.24 int32 errorCode; 2.25 //Variables used during measurements 2.26 +#ifdef MEAS__TURN_ON_SYSTEM_MEAS 2.27 TSCountLowHigh endSusp; 2.28 +#endif 2.29 //Variables used in random-backoff, for master-lock and waiting for work 2.30 uint32_t seed1 = rand()%1000; // init random number generator for backoffs 2.31 uint32_t seed2 = rand()%1000; 2.32 @@ -120,7 +125,7 @@ 2.33 2.34 HOLISTIC__CoreCtrl_Setup; 2.35 2.36 - DEBUG__printf1(TRUE, "started coreCtrlr", thisCoresIdx ); 2.37 + DEBUG__printf1(TRUE, "started coreCtrlr on core %d", thisCoresIdx ); 2.38 2.39 //====================== The Core Controller ====================== 2.40 while(1) //An endless loop is just one way of doing the control structure 2.41 @@ -222,7 +227,7 @@ 2.42 pthread_exit( NULL ); 2.43 } 2.44 2.45 -inline uint32_t 2.46 +uint32_t 2.47 randomNumber() 2.48 { 2.49 _VMSMasterEnv->seed1 = (uint32)(36969 * (_VMSMasterEnv->seed1 & 65535) + 2.50 @@ -237,7 +242,7 @@ 2.51 /*Busy-wait for a random number of cycles -- chooses number of cycles 2.52 * differently than for the too-many-tries-to-get-lock backoff 2.53 */ 2.54 -inline void 2.55 +void 2.56 doBackoff_for_TooLongWithNoWork( int32 numRepsWithNoWork, uint32 *seed1, 2.57 uint32 *seed2 ) 2.58 { int32 i, waitIterations; 2.59 @@ -256,7 +261,7 @@ 2.60 /*Busy-waits for a random number of cycles -- chooses number of cycles 2.61 * differently than for the no-work backoff 2.62 */ 2.63 -inline void 2.64 +void 2.65 doBackoff_for_TooLongToGetLock( int32 numTriesToGetLock, uint32 *seed1, 2.66 uint32 *seed2 ) 2.67 { int32 i, waitIterations;
3.1 --- a/HW_Dependent_Primitives/VMS__HW_measurement.c Mon Sep 03 03:34:54 2012 -0700 3.2 +++ b/HW_Dependent_Primitives/VMS__HW_measurement.c Wed Oct 24 00:00:22 2012 -0700 3.3 @@ -4,6 +4,7 @@ 3.4 #include <linux/perf_event.h> 3.5 #include <errno.h> 3.6 #include <sys/syscall.h> 3.7 +#include <sys/prctl.h> 3.8 #include <linux/prctl.h> 3.9 3.10 #include "../VMS.h" 3.11 @@ -35,7 +36,7 @@ 3.12 ); 3.13 if (_VMSMasterEnv->cycles_counter_fd[coreIdx]<0){ 3.14 fprintf(stderr,"On core %d: ",coreIdx); 3.15 - perror("Failed to open cycles counter"); 3.16 + perror("Failed to open cycles counter (does counters dir exist?)"); 3.17 } 3.18 hw_event.type = PERF_TYPE_HARDWARE; 3.19 hw_event.config = PERF_COUNT_HW_INSTRUCTIONS; //instrs
4.1 --- a/HW_Dependent_Primitives/VMS__HW_measurement.h Mon Sep 03 03:34:54 2012 -0700 4.2 +++ b/HW_Dependent_Primitives/VMS__HW_measurement.h Wed Oct 24 00:00:22 2012 -0700 4.3 @@ -50,7 +50,7 @@ 4.4 /* clobber */ : "%eax", "%edx" \ 4.5 ); 4.6 4.7 -inline TSCount getTSCount(); 4.8 + TSCount getTSCount(); 4.9 4.10 4.11 //For code that calculates normalization-offset between TSC counts of
5.1 --- a/HW_Dependent_Primitives/VMS__primitives.c Mon Sep 03 03:34:54 2012 -0700 5.2 +++ b/HW_Dependent_Primitives/VMS__primitives.c Wed Oct 24 00:00:22 2012 -0700 5.3 @@ -17,7 +17,7 @@ 5.4 * some wrapper-libraries (but only "int" version, to warn users to check 5.5 * carefully that it's safe) 5.6 */ 5.7 -inline void 5.8 +void 5.9 VMS_int__reset_slaveVP_to_TopLvlFn( SlaveVP *slaveVP, TopLevelFnPtr fnPtr, 5.10 void *dataParam) 5.11 { void *stackPtr; 5.12 @@ -61,7 +61,7 @@ 5.13 * 5.14 *This preserves the stack state existed at time slave was suspended. 5.15 */ 5.16 -inline void 5.17 +void 5.18 VMS_int__point_slaveVP_to_OneParamFn( SlaveVP *slaveVP, void *fnPtr, 5.19 void *param) 5.20 { void *stackPtr; 5.21 @@ -102,7 +102,7 @@ 5.22 * 5.23 *This preserves the stack state existed at time slave was suspended. 5.24 */ 5.25 -inline void 5.26 +void 5.27 VMS_int__point_slaveVP_to_TwoParamFn( SlaveVP *slaveVP, void *fnPtr, 5.28 void *param1, void *param2) 5.29 { void *stackPtr;
6.1 --- a/HW_Dependent_Primitives/VMS__primitives.h Mon Sep 03 03:34:54 2012 -0700 6.2 +++ b/HW_Dependent_Primitives/VMS__primitives.h Wed Oct 24 00:00:22 2012 -0700 6.3 @@ -43,11 +43,11 @@ 6.4 void 6.5 VMS_int__return_to_addr_in_ptd_to_loc(void *ptdToLoc); 6.6 6.7 -inline void 6.8 +void 6.9 VMS_int__point_slaveVP_to_OneParamFn( SlaveVP *slaveVP, void *fnPtr, 6.10 void *param); 6.11 6.12 -inline void 6.13 +void 6.14 VMS_int__point_slaveVP_to_TwoParamFn( SlaveVP *slaveVP, void *fnPtr, 6.15 void *param1, void *param2); 6.16
7.1 --- a/Services_Offered_by_VMS/Lang_Constructs/VMS_Lang.h Mon Sep 03 03:34:54 2012 -0700 7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 7.3 @@ -1,44 +0,0 @@ 7.4 -/* 7.5 - * Copyright 2009 OpenSourceStewardshipFoundation.org 7.6 - * Licensed under GNU General Public License version 2 7.7 - * 7.8 - * Author: seanhalle@yahoo.com 7.9 - * 7.10 - */ 7.11 - 7.12 -#ifndef _VMS_LANG_CONSTRUCTS_H 7.13 -#define _VMS_LANG_CONSTRUCTS_H 7.14 - 7.15 -#include "VMS_impl/VMS_primitive_data_types.h" 7.16 - 7.17 -/*This header defines everything specific to the VMS provided language 7.18 - * constructs. 7.19 - *Such constructs are used in application code, mixed-in with calls to 7.20 - * constructs of the VMS-based language. 7.21 - */ 7.22 -inline void 7.23 -handleMalloc( SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv *semEnv); 7.24 -inline void 7.25 -handleFree( SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv *semEnv ); 7.26 -inline void 7.27 -handleTransEnd(SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv*semEnv); 7.28 -inline void 7.29 -handleTransStart( SSRSemReq *semReq, SlaveVP *requestingSlv, 7.30 - SSRSemEnv *semEnv ); 7.31 -inline void 7.32 -handleAtomic( SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv *semEnv); 7.33 -inline void 7.34 -handleStartFnSingleton( SSRSemReq *semReq, SlaveVP *reqstingSlv, 7.35 - SSRSemEnv *semEnv ); 7.36 -inline void 7.37 -handleEndFnSingleton( SSRSemReq *semReq, SlaveVP *requestingSlv, 7.38 - SSRSemEnv *semEnv ); 7.39 -inline void 7.40 -handleStartDataSingleton( SSRSemReq *semReq, SlaveVP *reqstingSlv, 7.41 - SSRSemEnv *semEnv ); 7.42 -inline void 7.43 -handleEndDataSingleton( SSRSemReq *semReq, SlaveVP *requestingSlv, 7.44 - SSRSemEnv *semEnv ); 7.45 - 7.46 -#endif /* _VMS_LANG_CONSTRUCTS_H */ 7.47 -
8.1 --- a/Services_Offered_by_VMS/Measurement_and_Stats/probes.c Mon Sep 03 03:34:54 2012 -0700 8.2 +++ b/Services_Offered_by_VMS/Measurement_and_Stats/probes.c Wed Oct 24 00:00:22 2012 -0700 8.3 @@ -32,7 +32,7 @@ 8.4 */ 8.5 8.6 //============================ Helpers =========================== 8.7 -inline void 8.8 +void 8.9 doNothing() 8.10 { 8.11 }
9.1 --- a/Services_Offered_by_VMS/Measurement_and_Stats/probes.h Mon Sep 03 03:34:54 2012 -0700 9.2 +++ b/Services_Offered_by_VMS/Measurement_and_Stats/probes.h Wed Oct 24 00:00:22 2012 -0700 9.3 @@ -48,6 +48,8 @@ 9.4 float64 endSecs; \ 9.5 float64 interval; \ 9.6 DblHist *hist; /*if NULL, then is single interval probe*/ 9.7 +#else 9.8 + #define PROBES__Insert_timestamps_and_intervals_into_probe_struct 9.9 #endif 9.10 #ifdef PROBES__USE_PERF_CTR_PROBES 9.11 #define PROBES__Insert_timestamps_and_intervals_into_probe_struct \ 9.12 @@ -118,7 +120,7 @@ 9.13 // This means probes have zero impact on performance when off 9.14 //============================================================= 9.15 9.16 -#ifdef PROBES__TURN_ON_STATS_PROBES 9.17 +#ifdef SERVICE__TURN_ON_STATS_PROBES 9.18 9.19 #define PROBES__Create_Probe_Bookkeeping_Vars \ 9.20 _VMSMasterEnv->dynIntervalProbesInfo = \ 9.21 @@ -186,7 +188,7 @@ 9.22 #define VMS_WL__print_stats_of_probe( probeID ) ; /* do nothing */ 9.23 #define VMS_WL__print_stats_of_all_probes() ;/* do nothing */ 9.24 9.25 -#endif /* defined PROBES__TURN_ON_STATS_PROBES */ 9.26 +#endif /* defined SERVICE__TURN_ON_STATS_PROBES */ 9.27 9.28 #endif /* _PROBES_H */ 9.29
10.1 --- a/Services_Offered_by_VMS/Memory_Handling/vmalloc.c Mon Sep 03 03:34:54 2012 -0700 10.2 +++ b/Services_Offered_by_VMS/Memory_Handling/vmalloc.c Wed Oct 24 00:00:22 2012 -0700 10.3 @@ -7,15 +7,18 @@ 10.4 * Created on November 14, 2009, 9:07 PM 10.5 */ 10.6 10.7 + 10.8 #include <malloc.h> 10.9 -#include <inttypes.h> 10.10 #include <stdlib.h> 10.11 #include <stdio.h> 10.12 #include <string.h> 10.13 #include <math.h> 10.14 10.15 +#include "Histogram/Histogram.h" 10.16 #include "VMS_impl/VMS.h" 10.17 -#include "Histogram/Histogram.h" 10.18 + 10.19 +#include "vmalloc.h" 10.20 + 10.21 10.22 #define MAX_UINT64 0xFFFFFFFFFFFFFFFF 10.23 10.24 @@ -265,7 +268,12 @@ 10.25 foundChunk = removeSmallChunk(freeLists, freeListIdx); 10.26 10.27 //Mark as allocated 10.28 - foundChunk->prevChunkInFreeList = NULL; 10.29 + foundChunk->prevChunkInFreeList = NULL; 10.30 + 10.31 + #ifdef SERVICE__TURN_ON_VALGRIND 10.32 + VALGRIND_MAKE_MEM_UNDEFINED(foundChunk + 1,sizeRequested); 10.33 + #endif 10.34 + 10.35 return foundChunk + 1; 10.36 } 10.37 10.38 @@ -284,6 +292,11 @@ 10.39 MEAS__Capture_Post_Malloc_Point 10.40 10.41 //skip over the prolog by adding its size to the pointer return 10.42 + 10.43 + #ifdef SERVICE__TURN_ON_VALGRIND 10.44 + VALGRIND_MAKE_MEM_UNDEFINED(foundChunk + 1,sizeRequested); 10.45 + #endif 10.46 + 10.47 return foundChunk + 1; 10.48 } 10.49 10.50 @@ -331,6 +344,11 @@ 10.51 } 10.52 10.53 size_t chunkSize = getChunkSize(chunkToFree); 10.54 + 10.55 + #ifdef SERVICE__TURN_ON_VALGRIND 10.56 + VALGRIND_MAKE_MEM_UNDEFINED(chunkToFree,chunkSize); 10.57 + #endif 10.58 + 10.59 if(chunkSize < BIG_LOWER_BOUND) 10.60 { 10.61 containerIdx = (chunkSize/SMALL_CHUNK_SIZE)-1; 10.62 @@ -383,6 +401,11 @@ 10.63 //Create first element in lastContainer 10.64 MallocProlog *firstChunk = malloc( MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE ); 10.65 if( firstChunk == NULL ) {printf("Can't allocate initial memory\n"); exit(1);} 10.66 + 10.67 + #ifdef SERVICE__TURN_ON_VALGRIND 10.68 + VALGRIND_MAKE_MEM_NOACCESS(firstChunk,MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE); 10.69 + #endif 10.70 + 10.71 freeLists->memSpace = firstChunk; 10.72 10.73 //Touch memory to avoid page faults 10.74 @@ -398,7 +421,7 @@ 10.75 MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE - sizeof(MallocProlog)); 10.76 firstChunk->nextChunkInFreeList = NULL; 10.77 //previous element in the queue is the container 10.78 - firstChunk->prevChunkInFreeList = &freeLists->bigChunks[container-2]; 10.79 + firstChunk->prevChunkInFreeList = (MallocProlog*) &freeLists->bigChunks[container-2]; 10.80 10.81 freeLists->bigChunks[container-2] = firstChunk; 10.82 //Insert into bit search list
11.1 --- a/Services_Offered_by_VMS/Memory_Handling/vmalloc.h Mon Sep 03 03:34:54 2012 -0700 11.2 +++ b/Services_Offered_by_VMS/Memory_Handling/vmalloc.h Wed Oct 24 00:00:22 2012 -0700 11.3 @@ -9,11 +9,15 @@ 11.4 11.5 #ifndef _VMALLOC_H 11.6 #define _VMALLOC_H 11.7 +#include <inttypes.h> 11.8 +#include <stddef.h> 11.9 11.10 -#include <malloc.h> 11.11 -#include <inttypes.h> 11.12 #include "VMS_impl/VMS_primitive_data_types.h" 11.13 11.14 +#ifdef SERVICE__TURN_ON_VALGRIND 11.15 +#include Valgrind/memcheck.h 11.16 +#endif 11.17 + 11.18 #define SMALL_CHUNK_SIZE 32 11.19 #define SMALL_CHUNK_COUNT 4 11.20 #define LOWER_BOUND 128 //Biggest chunk size that is created for the small chunks
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 12.2 +++ b/Services_Offered_by_VMS/Memory_Handling/vmalloc.supp Wed Oct 24 00:00:22 2012 -0700 12.3 @@ -0,0 +1,29 @@ 12.4 +{ 12.5 + poolcreate 12.6 + Memcheck:Addr1 12.7 + fun:VMS_ext__create_free_list 12.8 +} 12.9 + 12.10 +{ 12.11 + poolcreate 12.12 + Memcheck:Addr4 12.13 + fun:VMS_ext__create_free_list 12.14 +} 12.15 +{ 12.16 + poolcreate 12.17 + Memcheck:Addr8 12.18 + fun:VMS_ext__create_free_list 12.19 +} 12.20 + 12.21 +{ 12.22 + vmsmalloc 12.23 + Memcheck:Addr8 12.24 + ... 12.25 + fun:VMS_int__malloc 12.26 +} 12.27 +{ 12.28 + vmsmalloc 12.29 + Memcheck:Addr4 12.30 + ... 12.31 + fun:VMS_int__malloc 12.32 +}
13.1 --- a/VMS.h Mon Sep 03 03:34:54 2012 -0700 13.2 +++ b/VMS.h Wed Oct 24 00:00:22 2012 -0700 13.3 @@ -282,7 +282,7 @@ 13.4 13.5 //============== =============== 13.6 13.7 -inline SlaveVP * 13.8 +SlaveVP * 13.9 VMS_int__create_slaveVP( TopLevelFnPtr fnPtr, void *dataParam ); 13.10 #define VMS_PI__create_slaveVP VMS_int__create_slaveVP 13.11 #define VMS_WL__create_slaveVP VMS_int__create_slaveVP 13.12 @@ -292,19 +292,19 @@ 13.13 SlaveVP * 13.14 VMS_ext__create_slaveVP( TopLevelFnPtr fnPtr, void *dataParam ); 13.15 13.16 -inline SlaveVP * 13.17 +SlaveVP * 13.18 VMS_int__create_slaveVP_helper( SlaveVP *newSlv, TopLevelFnPtr fnPtr, 13.19 void *dataParam, void *stackLocs ); 13.20 13.21 -inline void 13.22 +void 13.23 VMS_int__reset_slaveVP_to_TopLvlFn( SlaveVP *slaveVP, TopLevelFnPtr fnPtr, 13.24 void *dataParam); 13.25 13.26 -inline void 13.27 +void 13.28 VMS_int__point_slaveVP_to_OneParamFn( SlaveVP *slaveVP, void *fnPtr, 13.29 void *param); 13.30 13.31 -inline void 13.32 +void 13.33 VMS_int__point_slaveVP_to_TwoParamFn( SlaveVP *slaveVP, void *fnPtr, 13.34 void *param1, void *param2); 13.35 13.36 @@ -330,12 +330,12 @@ 13.37 //No WL version -- not safe! if use in WL, be sure data rd & wr is stable 13.38 13.39 13.40 -inline void 13.41 +void 13.42 VMS_int__get_master_lock(); 13.43 13.44 #define VMS_int__release_master_lock() _VMSMasterEnv->masterLock = UNLOCKED 13.45 13.46 -inline uint32_t 13.47 +uint32_t 13.48 VMS_int__randomNumber(); 13.49 13.50 //============== Request Related =============== 13.51 @@ -343,30 +343,30 @@ 13.52 void 13.53 VMS_int__suspend_slaveVP_and_send_req( SlaveVP *callingSlv ); 13.54 13.55 -inline void 13.56 +void 13.57 VMS_WL__add_sem_request_in_mallocd_VMSReqst( void *semReqData, SlaveVP *callingSlv ); 13.58 13.59 -inline void 13.60 +void 13.61 VMS_WL__send_sem_request( void *semReqData, SlaveVP *callingSlv ); 13.62 13.63 void 13.64 VMS_WL__send_create_slaveVP_req( void *semReqData, SlaveVP *reqstingSlv ); 13.65 13.66 -void inline 13.67 +void 13.68 VMS_WL__send_dissipate_req( SlaveVP *prToDissipate ); 13.69 13.70 -inline void 13.71 +void 13.72 VMS_WL__send_VMSSem_request( void *semReqData, SlaveVP *callingSlv ); 13.73 13.74 VMSReqst * 13.75 VMS_PI__take_next_request_out_of( SlaveVP *slaveWithReq ); 13.76 //#define VMS_PI__take_next_request_out_of( slave ) slave->requests 13.77 13.78 -//inline void * 13.79 +//void * 13.80 //VMS_PI__take_sem_reqst_from( VMSReqst *req ); 13.81 #define VMS_PI__take_sem_reqst_from( req ) req->semReqData 13.82 13.83 -void inline 13.84 +void 13.85 VMS_PI__handle_VMSSemReq( VMSReqst *req, SlaveVP *requestingSlv, void *semEnv, 13.86 ResumeSlvFnPtr resumeSlvFnPtr ); 13.87 13.88 @@ -378,7 +378,7 @@ 13.89 13.90 13.91 //========================= Utilities ======================= 13.92 -inline char * 13.93 +char * 13.94 VMS_int__strDup( char *str ); 13.95 13.96
14.1 --- a/VMS__PI.c Mon Sep 03 03:34:54 2012 -0700 14.2 +++ b/VMS__PI.c Wed Oct 24 00:00:22 2012 -0700 14.3 @@ -23,10 +23,10 @@ 14.4 */ 14.5 14.6 //========================= Local Declarations ======================== 14.7 -void inline 14.8 +void 14.9 handleMakeProbe( VMSSemReq *semReq, void *semEnv, ResumeSlvFnPtr resumeFn ); 14.10 14.11 -void inline 14.12 +void 14.13 handleThrowException( VMSSemReq *semReq, void *semEnv, ResumeSlvFnPtr resumeFn ); 14.14 //======================================================================= 14.15 14.16 @@ -49,7 +49,7 @@ 14.17 * 14.18 *Turn function into macro that just accesses the request field 14.19 * 14.20 -inline void * 14.21 + void * 14.22 VMS_PI__take_sem_reqst_from( VMSReqst *req ) 14.23 { 14.24 return req->semReqData; 14.25 @@ -71,7 +71,7 @@ 14.26 * VMS-core steer the request to appropriate plugin 14.27 * Do the same for OS calls -- look later at it.. 14.28 */ 14.29 -void inline 14.30 +void 14.31 VMS_PI__handle_VMSSemReq( VMSReqst *req, SlaveVP *requestingSlv, void *semEnv, 14.32 ResumeSlvFnPtr resumeFn ) 14.33 { VMSSemReq *semReq; 14.34 @@ -84,6 +84,8 @@ 14.35 break; 14.36 case throw_excp: handleThrowException( semReq, semEnv, resumeFn); 14.37 break; 14.38 + default: 14.39 + break; 14.40 } 14.41 } 14.42
15.1 --- a/VMS__WL.c Mon Sep 03 03:34:54 2012 -0700 15.2 +++ b/VMS__WL.c Wed Oct 24 00:00:22 2012 -0700 15.3 @@ -94,7 +94,7 @@ 15.4 * 15.5 *The request handler has to call VMS_int__free_VMSReq for any of these 15.6 */ 15.7 -inline void 15.8 +void 15.9 VMS_WL__add_sem_request_in_mallocd_VMSReqst( void *semReqData, 15.10 SlaveVP *callingSlv ) 15.11 { VMSReqst *req; 15.12 @@ -111,7 +111,7 @@ 15.13 * to plugin 15.14 *Then it does suspend, to cause request to be sent. 15.15 */ 15.16 -inline void 15.17 +void 15.18 VMS_WL__send_sem_request( void *semReqData, SlaveVP *callingSlv ) 15.19 { VMSReqst req; 15.20 15.21 @@ -127,7 +127,7 @@ 15.22 /*May 2012 Not sure what this is.. looks like old idea for VMS semantic 15.23 * request 15.24 */ 15.25 -inline void 15.26 +void 15.27 VMS_WL__send_VMSSem_request( void *semReqData, SlaveVP *callingSlv ) 15.28 { VMSReqst req; 15.29
16.1 --- a/VMS__int.c Mon Sep 03 03:34:54 2012 -0700 16.2 +++ b/VMS__int.c Wed Oct 24 00:00:22 2012 -0700 16.3 @@ -11,8 +11,12 @@ 16.4 #include <inttypes.h> 16.5 #include <sys/time.h> 16.6 16.7 +#include <sched.h> 16.8 + 16.9 #include "VMS.h" 16.10 16.11 +#include <unistd.h> 16.12 +ssize_t read(int fd, void *buf, size_t count); 16.13 16.14 /* MEANING OF WL PI SS int 16.15 * These indicate which places the function is safe to use. They stand for: 16.16 @@ -23,7 +27,7 @@ 16.17 */ 16.18 16.19 16.20 -inline SlaveVP * 16.21 +SlaveVP * 16.22 VMS_int__create_slaveVP( TopLevelFnPtr fnPtr, void *dataParam ) 16.23 { SlaveVP *newSlv; 16.24 void *stackLocs; 16.25 @@ -42,7 +46,7 @@ 16.26 * be called from main thread or other thread -- never from code animated by 16.27 * a VMS virtual processor. 16.28 */ 16.29 -inline SlaveVP * 16.30 +SlaveVP * 16.31 VMS_ext__create_slaveVP( TopLevelFnPtr fnPtr, void *dataParam ) 16.32 { SlaveVP *newSlv; 16.33 char *stackLocs; 16.34 @@ -173,7 +177,7 @@ 16.35 /* 16.36 * 16.37 */ 16.38 -inline SlaveVP * 16.39 +SlaveVP * 16.40 VMS_int__create_slaveVP_helper( SlaveVP *newSlv, TopLevelFnPtr fnPtr, 16.41 void *dataParam, void *stackLocs ) 16.42 { 16.43 @@ -187,7 +191,7 @@ 16.44 VMS_int__reset_slaveVP_to_TopLvlFn( newSlv, fnPtr, dataParam ); 16.45 16.46 //============================= MEASUREMENT STUFF ======================== 16.47 - #ifdef PROBES__TURN_ON_STATS_PROBES 16.48 + #ifdef SERVICE__TURN_ON_STATS_PROBES 16.49 //TODO: make this TSCHiLow or generic equivalent 16.50 //struct timeval timeStamp; 16.51 //gettimeofday( &(timeStamp), NULL); 16.52 @@ -212,7 +216,7 @@ 16.53 } 16.54 16.55 16.56 -inline char * 16.57 +char * 16.58 VMS_int__strDup( char *str ) 16.59 { char *retStr; 16.60 16.61 @@ -224,12 +228,12 @@ 16.62 } 16.63 16.64 16.65 -inline void 16.66 +void 16.67 VMS_int__backoff_for_TooLongToGetLock( int32 numTriesToGetLock ); 16.68 16.69 -inline void 16.70 +void 16.71 VMS_int__get_master_lock() 16.72 - { int32 *addrOfMasterLock; 16.73 + { volatile int32 *addrOfMasterLock; 16.74 16.75 addrOfMasterLock = &(_VMSMasterEnv->masterLock); 16.76 16.77 @@ -246,7 +250,7 @@ 16.78 } 16.79 if( numTriesToGetLock > MASTERLOCK_RETRIES_BEFORE_YIELD ) 16.80 { numTriesToGetLock = 0; 16.81 - pthread_yield(); 16.82 + sched_yield(); 16.83 } 16.84 16.85 //try to get the lock 16.86 @@ -260,7 +264,7 @@ 16.87 * system rand because it takes much too long. 16.88 *Note, are passing pointers to the seeds, which are then modified 16.89 */ 16.90 -inline uint32_t 16.91 +uint32_t 16.92 VMS_int__randomNumber() 16.93 { 16.94 _VMSMasterEnv->seed1 = 36969 * (_VMSMasterEnv->seed1 & 65535) + 16.95 @@ -274,7 +278,7 @@ 16.96 /*Busy-waits for a random number of cycles -- chooses number of cycles 16.97 * differently than for the no-work backoff 16.98 */ 16.99 -inline void 16.100 +void 16.101 VMS_int__backoff_for_TooLongToGetLock( int32 numTriesToGetLock ) 16.102 { int32 i, waitIterations; 16.103 volatile double fakeWorkVar; //busy-wait fake work
17.1 --- a/VMS__startup_and_shutdown.c Mon Sep 03 03:34:54 2012 -0700 17.2 +++ b/VMS__startup_and_shutdown.c Wed Oct 24 00:00:22 2012 -0700 17.3 @@ -408,7 +408,7 @@ 17.4 { _VMSMasterEnv->slaveAssigner = animAssigner; 17.5 } 17.6 17.7 -VMS_SS__register_semantic_env( void *semanticEnv ) 17.8 +void VMS_SS__register_semantic_env( void *semanticEnv ) 17.9 { _VMSMasterEnv->semanticEnv = semanticEnv; 17.10 } 17.11 17.12 @@ -582,7 +582,7 @@ 17.13 VMS_int__free( _VMSMasterEnv->allAnimSlots ); 17.14 17.15 //============================= MEASUREMENT STUFF ======================== 17.16 - #ifdef PROBES__TURN_ON_STATS_PROBES 17.17 + #ifdef SERVICE__TURN_ON_STATS_PROBES 17.18 freeDynArrayDeep( _VMSMasterEnv->dynIntervalProbesInfo, &VMS_WL__free_probe); 17.19 #endif 17.20 //========================================================================
18.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 18.2 +++ b/__brch__Common_ancestor Wed Oct 24 00:00:22 2012 -0700 18.3 @@ -0,0 +1,34 @@ 18.4 +A HW branch for: 18.5 + 18.6 +generic MultiCore machines with x86 64bit instruction set 18.7 + 18.8 +This branch shouldn't be used, except as a lazy fall-back. Instead, try out other branches tuned to specific hardware platforms to find the one that performs best on your machine. Use the "exe_time_vs_task_size" project to generate curves of overhead, and compare result from various branches. 18.9 + 18.10 +Note, if this branch is used, then NUM_CORES in VMS_HW_specific_defs.h file has to be updated with the number of cores in your machine 18.11 + 18.12 + 18.13 +======== Background on branch naming ========= 18.14 + 18.15 +There are two kinds of branchs: ones used to develop features, and ones tuned to particular hardware. A given HW branch may combine features from several feature-branches, picking and choosing among them. 18.16 + 18.17 +After Feb 2012, branches are named by the scheme: 18.18 + 18.19 +feat__<feat_descr>__<HW_feat_dev_on> 18.20 + 18.21 +HW__<desc_of_HW_brch_tuned_for> 18.22 + 18.23 +where <HW_feat_dev_on> and <desc_of_HW_brch_tuned_for> follow the pattern: 18.24 + 18.25 +<num_socket> x <num_cores>_<Manuf>_<special_features> 18.26 + 18.27 +Examples: 18.28 + 18.29 +feat__exp_array_malloc 18.30 + 18.31 +feat__rand_backoff__4x10_Intel_WestmereEx 18.32 + 18.33 +HW__1x4_Intel_SandyBridge 18.34 + 18.35 +HW__4x10_Intel_WestmereEx 18.36 + 18.37 +HW__1x4_AMD_mobile
19.1 --- a/__brch__Dev_ML Mon Sep 03 03:34:54 2012 -0700 19.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 19.3 @@ -1,28 +0,0 @@ 19.4 -This branch is for developing the multi-language capability in VMS. The idea is to define langlets, whose constructs can be freely mixed together inside application code. No need to separate into distinct modules. A single function can use constructs from all the different langlets together inside itself. 19.5 - 19.6 - 19.7 -======== Background on branch naming ========= 19.8 - 19.9 -There are two kinds of branchs: ones used to develop features, and ones tuned to particular hardware. A given HW branch may combine features from several feature-branches, picking and choosing among them. 19.10 - 19.11 -After Feb 2012, branches are named by the scheme: 19.12 - 19.13 -feat__<feat_descr>__<HW_feat_dev_on> 19.14 - 19.15 -HW__<desc_of_HW_brch_tuned_for> 19.16 - 19.17 -where <HW_feat_dev_on> and <desc_of_HW_brch_tuned_for> follow the pattern: 19.18 - 19.19 -<num_socket> x <num_cores>_<Manuf>_<special_features> 19.20 - 19.21 -Examples: 19.22 - 19.23 -feat__exp_array_malloc 19.24 - 19.25 -feat__rand_backoff__4x10_Intel_WestmereEx 19.26 - 19.27 -HW__1x4_Intel_SandyBridge 19.28 - 19.29 -HW__4x10_Intel_WestmereEx 19.30 - 19.31 -HW__1x4_AMD_mobile
