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

ReadFileBuffer needs fix #253

Closed
ye-luo opened this issue Jun 6, 2017 · 7 comments
Closed

ReadFileBuffer needs fix #253

ye-luo opened this issue Jun 6, 2017 · 7 comments
Assignees
Labels

Comments

@ye-luo
Copy link
Contributor

ye-luo commented Jun 6, 2017

The unit test crashes in MPI when pp file is missing. This is introduced in #251
Error message cannot be printed correctly when a PP file is missing.
The reason is that is_open is not initialized and always set in open_file.
is_open must be initialized to false and set to false if an open failed.
open_file should check if a file is open or not before try to open anther file.

@ye-luo
Copy link
Contributor Author

ye-luo commented Jun 6, 2017

Please also avoid pseudopotentials/BFD/C.BFD.xml. This a bad file with nan in it. Though it doesn't really matter for this test, it is better to choose another one considering more tests may need this file.
See issue #43

@ye-luo
Copy link
Contributor Author

ye-luo commented Jun 6, 2017

Or just overwrite the bad one by a good one from the diamond tests.
@prckent can we just overwrite the bad one instead of waiting for issue #43.

@ye-luo
Copy link
Contributor Author

ye-luo commented Jun 6, 2017

APP_ABORT message is not consistent with the actually routine.

@ye-luo
Copy link
Contributor Author

ye-luo commented Jun 6, 2017

Can get_file_length be a member function of ReadFileBuffer?
Can we move ReadFileBuffer to individual files instead of mixing with ECPComponentBuilder class?
Have it in src/Utilities and we can probably use it in other cases.

@markdewing
Copy link
Contributor

The C.BFD.upf file as a 'nan' in it, but the C.BFD.xml file does not.

ReadFileBuffer could be moved to it's own file - something to do later, though.

I'm uncertain about get_file_length between OO design and functional design.
In OO design, the method operates on member variables (fin, length) and changes them. I find this couples the function to the class more tightly and makes it harder to understand.
In functional design, the function should be understandable in terms of inputs and outputs. This function works well for this.
I can make it it a member function of the class, but I'll make it more functional (ie, it will not operate on the member variables) - that should keep it easier to understand w/o referencing the whole class.

@prckent
Copy link
Contributor

prckent commented Jun 7, 2017

How often do we need get_file_length or similar functionality?

markdewing added a commit to markdewing/qmcpack that referenced this issue Jun 7, 2017
Address comments in issue QMCPACK#253.
 - initialize the value of is_open to false by default
 - Update the filename in the APP_ABORT messages
 - change get_file_length to be a member function.
@prckent
Copy link
Contributor

prckent commented Jun 8, 2017

Closed by #254

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants