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

Fortran runtime error when restarting phonon calculations with ph_mat.x #21

Open
AldiSaraiva opened this issue Sep 30, 2024 · 3 comments

Comments

@AldiSaraiva
Copy link

AldiSaraiva commented Sep 30, 2024

I am using the code to perform Raman calculations with QE 7.3.1, and overall, it seems to work very well. However, when I try to restart a phonon calculation in a cluster with ph_mat.x, I encounter the following error just before the phonon calculation completes.

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7f1dea023cda in ???
#1  0x7f1dea022d75 in ???
#2  0x7f1de9e4fcff in ???
#3  0x7f1dea2a7766 in ???
#4  0x7f1dea2a9171 in ???
#5  0x7f1dea29f526 in ???
#6  0x7f1dea29f955 in ???
#7  0x40c296 in elphfil_epc_
	at ~/qe-7.3.1-ReleasePack/qe-7.3.1/QERaman/src/supp.f90:163
#8  0x40b3f9 in do_phonon2_
	at ~/Codes/Packages/qe-7.3.1-ReleasePack/qe-7.3.1/QERaman/src/do_phonon2.f90:153
#9  0x403b81 in phonon2
	at ~/Codes/Packages/qe-7.3.1-ReleasePack/qe-7.3.1/QERaman/src/phonon2.f90:78
#10  0x403a3c in main
	at ~/Codes/Packages/qe-7.3.1-ReleasePack/qe-7.3.1/QERaman/src/phonon2.f90:43

Is restarting phonon calculations with ph_mat.x officially supported, or is there a plan to implement this feature in future releases?

@AldiSaraiva
Copy link
Author

After testing different configurations, I believe I have found the source of the issue where the array wq was not properly allocated when restarting the ph_mat.x calculation. This problem occurred in the file supp.f90.

To resolve it, I added the following line of code in supp.f90 at line 84:
ALLOCATE(wq(nqs))
Here's a snippet of where it was added:

INTEGER :: ftau(3,48)
INTEGER, EXTERNAL :: find_free_unit, atomic_number
ALLOCATE(wq(nqs))

filelph = TRIM(prefix) // '.elph'

This change allowed the code to continue without the segmentation fault error. While I'm not certain if this would be considered an "official" fix, it works as a workaround and might help others encountering a similar issue during restart.

@nguyen-group
Copy link
Owner

Hi @AldiSaraiva

I really appreciate your efforts to point out the issue and bug our code.
I did not realize this restart issue since I never restarted the program. But it is an important issue, and your fixing could help. I will work on this issue and make a patch.

Best,
Nguyen

@AldiSaraiva
Copy link
Author

Hi Nguyen,

Thank you for your kind words and for acknowledging the issue. I'm glad that my input could be helpful, and I truly appreciate your efforts to look into it. Also, thank you for sharing your code with the community.

Best regards,

Aldi

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

No branches or pull requests

2 participants