I created a MT application that during the simulation save some information for each simulated event.
At the end of the run, the Master calls the method “Merge” and then I can save all the data in a file.
Here is my question:
If I simulate too many events, the amount of RAM needed to store all the information is too high.
I’d like to know if it is possible to perform a “Merge”, save the data on disk and reset the variables that store the data in the Workers, every X simulated events.
So, for example, if I execute /run/beamOn 1000000, every 100 k events, the Merge method is called, the master saves the data and the RAM is freed, ready for the next 100 k events.
I thought about using the mutex, but I fear that since all worker have to access the same file on disk so frequently, there would be a queue, and thus the simulation speed would be affected.