changeset 190:a8312581709c false_sharing

merge of changes from xoanon
author Merten Sach <msach@mailbox.tu-berlin.de>
date Fri, 03 Feb 2012 19:04:12 +0100
parents 91d0d2e06719 f89bf9e368f5
children 0320b49ca013
files CoreLoop.c
diffstat 2 files changed, 7 insertions(+), 9 deletions(-) [+]
line diff
     1.1 --- a/CoreLoop.c	Fri Feb 03 17:57:09 2012 +0100
     1.2 +++ b/CoreLoop.c	Fri Feb 03 19:04:12 2012 +0100
     1.3 @@ -48,7 +48,7 @@
     1.4     volatile int32 *masterLock;
     1.5     VirtProcr      *masterVP;
     1.6     
     1.7 -   double         workspace1,workspace2; //variables for master lock busy waiting
     1.8 +   volatile double workspace1,workspace2; //variables for master lock busy waiting
     1.9  
    1.10     // init random number generator for retries
    1.11     uint32_t seed1 = rand()%1000;
    1.12 @@ -144,12 +144,11 @@
    1.13         {    //queue was empty, so get master lock
    1.14  
    1.15  	if(numMasterInARow > 2){
    1.16 -                wait_iterations=(randomNumber(&seed1, &seed2) % (numMasterInARow*numMasterInARow))*100;
    1.17 +                wait_iterations=(randomNumber(&seed1, &seed2) % (numMasterInARow*NUM_CORES));
    1.18  	   	int i;
    1.19  	  	for(i=0; i<wait_iterations; i++)
    1.20                  {/*busy wait*/
    1.21                      workspace1 += (workspace1 + 32)/2;
    1.22 -                    workspace2 += (workspace2 + 23.2)/1.4;
    1.23                  }
    1.24          }
    1.25                   
    1.26 @@ -171,7 +170,6 @@
    1.27  	   for(i=0; i<wait_iterations; i++)
    1.28             {/*busy wait*/
    1.29                  workspace1 += (workspace1 + 32)/2;
    1.30 -                workspace2 += (workspace2 + 23.2)/1.4;
    1.31             }
    1.32  	}
    1.33  
    1.34 @@ -211,9 +209,9 @@
    1.35            #endif
    1.36            //==================================================
    1.37     }//CoreLoop
    1.38 -   
    1.39 -   return (workspace1 + workspace2); //gcc fake out for -O3
    1.40 - }
    1.41 +  
    1.42 +   return (void*)&workspace1; //gcc fake out for -O3
    1.43 +}
    1.44  
    1.45  inline uint32_t
    1.46  randomNumber(uint32_t* seed1, uint32_t* seed2){
     2.1 --- a/VMS_defs.h	Fri Feb 03 17:57:09 2012 +0100
     2.2 +++ b/VMS_defs.h	Fri Feb 03 19:04:12 2012 +0100
     2.3 @@ -81,7 +81,7 @@
     2.4  
     2.5     // tradeoff amortizing master fixed overhead vs imbalance potential
     2.6     // when work-stealing, can make bigger, at risk of losing cache affinity
     2.7 -#define NUM_SCHED_SLOTS  5
     2.8 +#define NUM_SCHED_SLOTS  3
     2.9  
    2.10  #define MIN_WORK_UNIT_CYCLES 20000
    2.11  
    2.12 @@ -91,7 +91,7 @@
    2.13  #define VIRT_PROCR_STACK_SIZE 0x8000 /* 32K */
    2.14  
    2.15     // memory for VMS__malloc
    2.16 -#define MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE 0x10000000 /* 256M */
    2.17 +#define MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE 0x40000000 /* 1G */
    2.18  
    2.19  #define CACHE_LINE 64
    2.20  #define PAGE_SIZE 4096