Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize io #49

Merged
merged 2 commits into from
Jul 14, 2018
Merged

Initialize io #49

merged 2 commits into from
Jul 14, 2018

Conversation

pietrodelugas
Copy link

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
Copy link
Owner

andreww commented Apr 3, 2018

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
Copy link
Author

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

tdaff and others added 2 commits April 4, 2018 11:24
Initializing the IO error codes each time that a xml file
in open for reading may become cumbersome in parallel application
with many processes opening scratch file for tests. In this case
it is preferable to run setup_io just with one node and propagate the
results to all other nodes.
I have redefined setup_io as an interface which refers to 2 module
procedures. setup_io_scracth which is the former  setup_io routine and
a setup_io_with_data where err_code eor_code and eof_code are provided
as arguments with which io_err, io_eor and io_eof are initialized.
I have added a private logical variable io_init that is toggled to true by
setup_io on exit. setup_io checks the io_init variable when starting and
in true returns without no further actions.
@pietrodelugas
Copy link
Author

the branch has been rebased to testing

@andreww
Copy link
Owner

andreww commented Apr 5, 2018

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 pietrodelugas changed the base branch from testing to master July 12, 2018 08:39
@pietrodelugas
Copy link
Author

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

@andreww andreww merged commit 9c6716e into andreww:master Jul 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants