|
[Sponsors] |
May 30, 2013, 11:39 |
what does cache do?
|
#1 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
Code:
cache { grad(U); }
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
June 9, 2013, 06:58 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Hi Ehsan,
A bit more context to the question would make it a lot easier to help... in other words, how is this being used? In even other words, how can I test what this does, if you don't indicate how you've tried to use it!? Best regards, Bruno
__________________
|
|
June 9, 2013, 08:01 |
|
#3 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
Hi
I saw it in a case I was curious about only that what does.never mind.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
June 9, 2013, 08:07 |
|
#4 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Then I guess I'll have to give a generic answer ... the term "cache" is explained in Wikipedia: http://en.wikipedia.org/wiki/Cache_%28computing%29
Quote:
__________________
|
||
October 27, 2019, 07:19 |
|
#5 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
Hi all,
I am just interested which fields should be cached and when? It is obvious that recalculating a field requires much longer than caching it after the first evaluation. However, how can we determine, which field we should cache and which not?
Is there any rule or any hint? E.g., we could cache actually each field Okay, if it is just needed once, then it will probably decrease the calculation speed a bit based on caching the data always. However, it was just an example.
__________________
Keep foaming, Tobias Holzmann |
|
April 8, 2020, 02:03 |
|
#6 | |
New Member
Jaap Stolk
Join Date: Nov 2014
Posts: 11
Rep Power: 11 |
Quote:
Only when using memory takes no time. With recent CPU's the calculation times and the number of cores has improved much faster than memory bandwidth. CPU-cache is practically irrelevant since OpenFOAM cycles through a large dataset that is usually larger than could fit in the CPU-cache. If the memory bandwidth is the bottleneck on your hardware, it may be faster to re-calculate the value instead of saving a copy. It also depends on how difficult it is to re-calculate the value. what works for "U" may not work for other values. Take a run that is typical of what you are using the hardware for (cell size, solver selection, decomposition, etc.) and run that twice, with only the cache U disable as difference between the settings, and check which one runs faster. Same for hyper-threading: hyper-threading usually makes CFD's run slower but I had some quad-core systems with quad-channel RAM. On that specific hardware, hyper-threading enabled (8 threads) was slightly faster. Just test it with a typical workload. |
||
August 16, 2022, 10:50 |
|
#7 |
Senior Member
Giles Richardson
Join Date: Jun 2012
Location: Cambs UK
Posts: 100
Rep Power: 13 |
||
August 18, 2022, 09:42 |
|
#8 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
No you don't. You don't need to cache any quantity but if it is used several times, its much cheaper to save the first calculation and simply take the results in any other place.
__________________
Keep foaming, Tobias Holzmann |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Superlinear speedup in OpenFOAM 13 | msrinath80 | OpenFOAM Running, Solving & CFD | 18 | March 3, 2015 05:36 |
copy cache file to each processor | newOFuser | OpenFOAM | 2 | August 7, 2012 17:06 |
row cache lock!!cfx-slover problem | Della | CFX | 0 | March 19, 2011 03:34 |
Can't cache (1024, 0) | HANA | FLUENT | 0 | December 6, 2008 02:27 |
Ram, cache and cpu upgrade help | zonexo | Main CFD Forum | 14 | January 24, 2007 09:05 |