andreww / fox

A Fortran XML library
https://andreww.github.io/fox/
Other
60 stars 51 forks source link

Initialize io #49

Closed pietrodelugas closed 6 years ago

pietrodelugas commented 6 years ago

The current setup_io opened a scratch file whenever a file was opened for reading. This may become cumbersome when the library is used in parallel MPI programs and has to read more then one file. I have added a flag in setup_io that is toggled to true as soon as setup_io initializes io_err, io_eor and io_eof, and on successive calls of setup_io the routine returns without performing any more test. I have also added the possibility to initialize the error codes by providing their values as arguments to setup_io. This can be useful in parallel application with one node that performs the test on the scratch file and then broadcasts the result to other nodes which will setup the error codes using the interface with the 3 err codes in input.

andreww commented 6 years ago

I don't really understand the need for this change, but then I've only ever used FoX from one process and done all of the XML IO there. Is opening a scratch file on all nodes a performance problem compared to multiple processes reading XML documents?

Could you also rebase this branch on master - so it doesn't have the colons patch or gfortran stop message included?

pietrodelugas commented 6 years ago

system admistrators started to complain because the program was opening thousands of scratch files :). I will do the rebase, thanks !!!

pietrodelugas commented 6 years ago

the branch has been rebased to testing

andreww commented 6 years ago

could you point this at my master branch, not testing (which was me setting up the continuous integration - my aim isn't to test new features there although the name is rather ambiguous).

pietrodelugas commented 6 years ago

sorry Andrew. I was sure to have redirected the pull request to the master branch long time ago.