I have a fortran code that needs to read a series of ascii data files (which together make up about 25 GB). Basically, the code opens this ascii file, reads the information and uses it to perform some operations, and then closes it. Then another file opens, reads the information, performs some operations and closes it again. And so on with the rest of the ascii files.
In general, each full run takes about 10 hours. I usually have to run several independent calculations with different parameters, and the way I do it is to execute each independent calculation sequentially, so in the end, if I have 10 independent calculations, the total processor time is 100 hours.
A faster way would be to start 10 independent calculations simultaneously using different processors on the cluster machine, but the problem is that if this calculation should open and read data from a given ascii file that was already open and used by another calculation, then the code clearly shows a mistake.
I wonder if there is a way to check if a given ascii file is already used by another calculation, and if so, ask the code to wait until the ascii file is finally closed.
Any help would be very helpful. Thank you very much in advance.
Obamakoak.
source share