Browse Source

Merge pull request #2399 from martin-frbg/buffersize

Make BUFFER_SIZE configurable at build time
tags/v0.3.9
Martin Kroeker GitHub 6 years ago
parent
commit
59ebe3636a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions
  1. +9
    -0
      Makefile.rule
  2. +4
    -0
      cmake/system.cmake
  3. +4
    -0
      common_x86_64.h

+ 9
- 0
Makefile.rule View File

@@ -97,6 +97,15 @@ VERSION = 0.3.9.dev
# they need to wait for the preceding API calls to finish or risk data corruption. # they need to wait for the preceding API calls to finish or risk data corruption.
# NUM_PARALLEL = 2 # NUM_PARALLEL = 2


# When multithreading, OpenBLAS needs to use a memory buffer for communicating
# and collating results for individual subranges of the original matrix. Since
# the original GotoBLAS of the early 2000s, the default size of this buffer has
# been set at a value of 32<<20 (which is 32MB) on x86_64 , twice that on PPC.
# If you expect to handle large problem sizes (beyond about 30000x30000) uncomment
# this line and adjust the (32<<n) factor if necessary. Usually an insufficient value
# manifests itself as a crash in the relevant scal kernel (sscal_k, dscal_k etc)
# BUFFERSIZE = 25

# If you don't need to install the static library, please comment this in. # If you don't need to install the static library, please comment this in.
# NO_STATIC = 1 # NO_STATIC = 1




+ 4
- 0
cmake/system.cmake View File

@@ -289,6 +289,10 @@ set(CCOMMON_OPT "${CCOMMON_OPT} -DMAX_CPU_NUMBER=${NUM_THREADS}")


set(CCOMMON_OPT "${CCOMMON_OPT} -DMAX_PARALLEL_NUMBER=${NUM_PARALLEL}") set(CCOMMON_OPT "${CCOMMON_OPT} -DMAX_PARALLEL_NUMBER=${NUM_PARALLEL}")


if (BUFFERSIZE)
set(CCOMMON_OPT "${CCOMMON_OPT} -DBUFFERSIZE=${BUFFERSIZE}")
endif ()

if (USE_SIMPLE_THREADED_LEVEL3) if (USE_SIMPLE_THREADED_LEVEL3)
set(CCOMMON_OPT "${CCOMMON_OPT} -DUSE_SIMPLE_THREADED_LEVEL3") set(CCOMMON_OPT "${CCOMMON_OPT} -DUSE_SIMPLE_THREADED_LEVEL3")
endif () endif ()


+ 4
- 0
common_x86_64.h View File

@@ -225,7 +225,11 @@ static __inline int blas_quickdivide(unsigned int x, unsigned int y){
#endif #endif
#define HUGE_PAGESIZE ( 2 << 20) #define HUGE_PAGESIZE ( 2 << 20)


#ifndef BUFFERSIZE
#define BUFFER_SIZE (32 << 20) #define BUFFER_SIZE (32 << 20)
#else
#define BUFFER_SIZE (32 << BUFFERSIZE)
#endif


#define SEEK_ADDRESS #define SEEK_ADDRESS




Loading…
Cancel
Save