[QE-developers] Segmentation fault in wann2kcw

Colonna Nicola (PSI) nicola.colonna at psi.ch
Tue Nov 29 14:55:29 CET 2022


Dear Jacob,

 yes, you are correct.
 The code was erroneously trying to write on file nbnd "wannier-like" objects that instead have and actual
 dimension of num_wann < nbnd (exactly because of the disentanglement procedure, as you said).

Best regards,

Nicola

-----------------------------------------------------
PAUL SCHERRER INSTITUT
Nicola S. Colonna
WHGA/150
CH-5232 Villigen-PSI
________________________________
From: developers <developers-bounces at lists.quantum-espresso.org> on behalf of Jacob Williams <jacob.z.williams at duke.edu>
Sent: Sunday, 27 November 2022 22:30
To: General discussion list for Quantum ESPRESSO developers <developers at lists.quantum-espresso.org>
Subject: Re: [QE-developers] Segmentation fault in wann2kcw


Dear Nicola,



This patch worked perfectly! Thanks so much for your prompt response. Out of curiosity, is this bug due to a miscommunication stemming from excluded bands or disentanglement—since nbnd (from PWSCF) and the “effective_nbnd”==num_wann differ?



Sincerely yours,



Jacob Williams

Ph.D. candidate, Yang group

Duke University Department of Chemistry



From: developers <developers-bounces at lists.quantum-espresso.org> on behalf of Colonna Nicola (PSI) <nicola.colonna at psi.ch>
Date: Friday, November 25, 2022 at 8:28 AM
To: developers at lists.quantum-espresso.org <developers at lists.quantum-espresso.org>
Subject: Re: [QE-developers] Segmentation fault in wann2kcw

Dear Jacob,



 Thanks for reporting this. It's a (known) bug. It will be fixed in the next official release of KCW.

 In the meanwhile, please try the following patch:



diff --git a/KCW/src/kcw_io_new.f90 b/KCW/src/kcw_io_new.f90

index 379114d30..da248ec23 100644

--- a/KCW/src/kcw_io_new.f90

+++ b/KCW/src/kcw_io_new.f90

@@ -516,7 +516,7 @@ MODULE io_kcw

         !

         IF ( my_bgrp_id == root_bgrp_id ) CALL write_wfc( iunpun, &

              filename, root_bgrp, intra_bgrp_comm, ik_g, tpiba*xk(:,ik), &

-             ispin, nspin, evc0, npw_g, gamma_only, nbnd, &

+             ispin, nspin, evc0, npw_g, gamma_only, num_wann, &

              igk_l2g_kdip(:), ngk(ik), tpiba*bg(:,1), tpiba*bg(:,2), &

              tpiba*bg(:,3), mill_k, 1.D0 )

         !

@@ -633,6 +633,7 @@ MODULE io_kcw

      USE mp,                   ONLY : mp_sum, mp_max

      USE io_base,              ONLY : read_wfc

      USE lsda_mod,             ONLY : nspin, isk, nspin

+     USE control_kcw,          ONLY : num_wann

      !

      IMPLICIT NONE

      !

@@ -722,7 +723,7 @@ MODULE io_kcw

      ! ... here one should check for consistency between what is read

      ! ... and what is expected

      !

-     IF ( nbnd_ < nbnd ) THEN

+     IF ( nbnd_ < num_wann ) THEN

         WRITE (msg,'("The number of bands for this run is",I6,", but only",&

              & I6," bands were read from file")')  nbnd, nbnd_

         CALL errore ('pw_restart - read_collected_wfc', msg, 1 )



Please let me know if this fixes the issue.

Best REgards,



Nicola Colonna



-----------------------------------------------------

PAUL SCHERRER INSTITUT

Nicola S. Colonna


WHGA/150
CH-5232 Villigen-PSI

________________________________

From: developers <developers-bounces at lists.quantum-espresso.org> on behalf of Jacob Williams <jacob.z.williams at duke.edu>
Sent: Wednesday, 23 November 2022 15:20
To: developers at lists.quantum-espresso.org <developers at lists.quantum-espresso.org>
Subject: [QE-developers] Segmentation fault in wann2kcw



Dear all,



I’ve run into a problem with segfaults in the part of KCW::wann2kcw that writes the rotated wavefunction for molecules in a supercell. The problem seems to occur when the cell size is big enough.



Here I ran water with 4 occupied and 3 empty bands (disentangled from 14 nscf bands), in PBE with optimized norm-conserving Vanderbilt pseudopotentials (sr correction). The ecutwfc = 100 Ry, and unit cell size is 15 angstroms (ibrav = 1).



Any help in understanding the origin of this segfault would be appreciated! Thank you in advance.



Here is the stack trace (Intel compiler and MKL, MPI but no OpenMP, Linux machine):

forrtl: severe (174): SIGSEGV, segmentation fault occurred

Image              PC                Routine            Line        Source

kcw.x              0000000000F5FE9A  Unknown               Unknown  Unknown

libpthread-2.28.s  00007FCEC88E0730  Unknown               Unknown  Unknown

kcw.x              00000000009E46CD  mp_wave_mp_mergew         102  mp_wave.f90

kcw.x              00000000008F4B96  io_base_mp_write_         176  io_base.f90

kcw.x              00000000004329CB  io_kcw_mp_write_m         517  kcw_io_new.f90

kcw.x              00000000004072D0  wann2kcw_                  30  wann2kcw.f90

kcw.x              000000000040721B  MAIN__                     49  kcw.f90

kcw.x              0000000000407162  Unknown               Unknown  Unknown

libc-2.28.so       00007FCEC85AD09B  __libc_start_main     Unknown  Unknown

kcw.x              000000000040706A  Unknown               Unknown  Unknown





Sincerely yours,



Jacob Williams

Ph.D. candidate, Yang group

Duke University Department of Chemistry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/developers/attachments/20221129/8c774801/attachment-0001.html>


More information about the developers mailing list