r/learnprogramming•
w0ss4g3

[F90] Performance impact when keeping a file open?

Solved

I have output files for various things in a code I've written - some of which I write into frequently, some I only need to write to at the end of the program.

Am I losing any performance by opening all of my files at once and keeping them open until the end, regardless of when I am planning to write into them?

Also, would I see any gain in speed if I were to only open files before I need to write into them and then close them while computations are going on?

Note my code can take up to a day to run in some cases, with the majority of the time spent in solving large linear systems.

Posted Dec 2, 2012, 5:52 PM UTC

1413
Loading comments…