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

Bug for 107_PW_OD_outputdos #746

Closed
Qianruipku opened this issue Feb 24, 2022 · 3 comments · Fixed by #796
Closed

Bug for 107_PW_OD_outputdos #746

Qianruipku opened this issue Feb 24, 2022 · 3 comments · Fixed by #796
Assignees
Labels
Bug Report (Exclude input and output) Bugs that only solvable with sufficient knowledge of DFT

Comments

@Qianruipku
Copy link
Collaborator

Qianruipku commented Feb 24, 2022

Describe the Bug

Sometime, 107_PW_OD_outputdos cannot pass the autotest

To Reproduce

Steps to reproduce the behavior:
0. Download develop branch

  1. Compile it with Makefile
  2. Test 107_PW_OD_outputdos
  3. Repeat until it shows ERROR:
    Sometimes it is OK:
    图片
    sometimes it is wrong:
    图片
    result.txt

Environment

  • OS: Ubuntu16.04
  • Compiler: oneapi2021
  • Optional Dependencies: [e.g. Intel MKL]

Additional Context

Add any other context about the problem here.

@Qianruipku
Copy link
Collaborator Author

Compiling it with cmake will also repeat it.

@caic99
Copy link
Member

caic99 commented Feb 24, 2022

Hi @Qianruipku ,
Similar cases have appeard before, see #637 .

@mohanchen mohanchen added the Bug Report (Exclude input and output) Bugs that only solvable with sufficient knowledge of DFT label Feb 25, 2022
@wenfei-li
Copy link
Collaborator

The reason behind this bug is that in calculating DOS_smearing, the program first takes the calculated DOS as input:

			 for(int i=0;i<number;i++)
			 {
				 in >> energy[i] >> dos[i];
			 }
			 if(!in.eof())
			 {
				 //std::cout<<"\n Read Over!"<<std::endl;
			 }
			 in.close();

This might have something to do with the input buffer. Also, it is bad practice to use the output file of the program as input file.
The way to fix this is to save the array that stores DOS and use that in calculating DOS_smearing, instead of reading from DOS.

@wenfei-li wenfei-li linked a pull request Mar 17, 2022 that will close this issue
@dyzheng dyzheng added this to To DO: test and solve the Issues in ABACUS_v2.2.0 Mar 22, 2022
@dyzheng dyzheng moved this from To DO: test and solve the Issues to Done in ABACUS_v2.2.0 Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report (Exclude input and output) Bugs that only solvable with sufficient knowledge of DFT
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

5 participants