Aptech Systems, Inc. Worldwide Headquarters
Aptech Systems, Inc.
2350 East Germann Road, Suite #21
Chandler, AZ 85286
Ready to Get Started?
Request Quote & Product Information
Training & Events
Step-by-step, informative lessons for those who want to dive into GAUSS and achieve their goals, fast.
Have a Specific Question?
Q&A: Register and Login
Premier Support and Platinum Premier Support are annually renewable membership programs that provide you with important benefits including technical support, product maintenance, and substantial cost-saving features for your GAUSS System or the GAUSS Engine.
Join our community to see why our users are considered some of the most active and helpful in the industry!
Where to Buy
Recent Tagsapplications character vectors CML CMLMT Constrained Optimization datasets dates dlibrary dllcall error error handling errors Excel file i/o floating network GAUSS Engine graphics GUI hotkeys installation Java API license licensing linux loading data loops matrices matrix matrix manipulation Maxlik MaxLikMT Memory optimization Optmum output PQG graphics procs RAM random numbers string functions strings structures threading Time Series writing data
Time Series 2.0 MT
Find out more now
Time Series MT 2.1
Find out more now
cache size and multi threading programming
In order to avoid "cache thrashing" and to improve multi threaded code performance, is it possible to change the cache size in the gauss.cfg file?
To which kind of cache does the line in the gauss.cfg file refer to ? L1 or L2 ?
The cache_size variable in the gauss.cfg file refers to L1 cache. However, it is used to to maximize the reuse of data in cache for any particular thread. The same optimum value would be correct for a single-threaded program or a multi-threaded program.
Also, this variable is rarely used now. In most cases GAUSS queries the system for CPU details and then uses that information to select the best parameters for the algorithm.
To quote your answer, "In most cases Gauss queries the system for CPU details" does it mean that if I write my own multi - threaded code then Gauss will set the cache_size on its own for what is needed by the number of threads? or does it only for internally multi threaded functions ?
Let's assume I have an Opteron with 64+64 K L1 cache, then by your experience, which is the best level of cache_size in gauss.cfg ?
The short answer is set it to 64.
However, the optimal cache size setting is independent of how many threads you create in your code. The level at which the cache size setting is used is at the level of the individual thread.
Let's say that you create 8 GAUSS level threads and that each of these threads create 4 threads internally. Each of these 32 threads will be handed some particular pieces of data and some functions to execute. Once the thread gets its orders, then it is here at this level when each individual thread is executing its orders that it will take into account the CPU cache size when choosing how it will execute its orders.
Therefore, if I have understood it well, cache size in gauss.cfg refers to the "cache per core" which is the figure I was mentioning when I referred to an Opteron.
Yes, it is cache per core. In almost all cases, a typical quad-core processor will have separate L1 cache per core.