question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Kernel sometimes dies when reading the SIESTA output hamiltonian.

See original GitHub issue

Describe the issue

For electronic structure calculations, I run SIESTA with the following lines in the input:

CDF.Save true CDF.Compress 9 SaveHS true SaveRho true

Afterwards, if the calculations finish correctly, I use the following commands to make the post-processing in SISL:

import sisl
import numpy as np

H = sisl.get_sile('input.fdf').read_hamiltonian()

It always worked correctly so far, but I am working with a molecule with relatively few atoms (56, carbons and hydrogens), SIESTA finishes the job but SISL fails to read the hamiltonian. In jupyter notebook, it says: “The kernel appears to have died. It will restart automatically.” In python 3.9: “STOP Error in reading data, not allocated”.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
zerothicommented, Nov 15, 2022

Ok, this is really weird.

The problem stems from https://github.com/zerothi/sisl/blob/730155dd3fd13970937fa7f116a5f6eb6a880e22/sisl/io/siesta/_src/hsx_read.f90#L372

However, that line is coded correct. The problem seems to be a compiler bug that I can also reproduce with GCC 11.2.0.

For instance, when adding this line:

  print *, Gamma, no_u == no_s, Gamma .neqv. (no_u == no_s)

I get the output

T T T

which should never occur (neqv means logical non-equivalence). I have tried to create a small minimal reproducing code, but I can’t…

program t

  integer :: n, m
  logical :: Gam

  call wrt()

  open(238, form="unformatted", status="old")
  call rd(Gam, n, m)
  print *, Gam, n == m, Gam .neqv. n == m
  call rd(Gam, n, m)
  print *, Gam, n == m, Gam .neqv. n == m
  call rd(Gam, n, m)
  print *, Gam, n == m, Gam .neqv. n == m
  call rd(Gam, n, m)
  print *, Gam, n == m, Gam .neqv. n == m

  close(238)
  
contains

  subroutine wrt()

    open(238, form="unformatted")
    write(238) .true.
    write(238) 14, 352
    write(238) .true.
    write(238) 14, 14
    write(238) .false.
    write(238) 14, 352
    write(238) .false.
    write(238) 14, 14
    close(238)
    
  end subroutine wrt

  subroutine rd(Gam, n, m)
    logical, intent(out) :: Gam
    integer, intent(out) :: n, m

    read(238) Gam
    read(238) n, m

  end subroutine rd
    
end program t

I think I’ll have to report this upstream… But this is just weird…

I have now tried to circumvent this by spelling out the checks, I could easily read your output file.

In any case, I would still recommend a different format than the HSX files. 😃

Thanks for reporting this!

1reaction
tfrederiksencommented, Nov 14, 2022

Did you try executing the above lines as a stand-alone script (instead of in a jupyter-notebook)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

User's Guide SIESTA MaX-1.3.0
and generates (or reads) the atomic basis set to be used in the simulation. These stages are docu- mented in the output file....
Read more >
Docs/tbtrans.tex · psml-support - siesta-project - GitLab
A first-principles materials simulation code using DFT. Homepage: https://siesta-project.org/siesta.
Read more >
subject:"Re\: \[SIESTA\-L\] \[\*\*\*Posible SPAM\*\*\*\]"
Hello William, Your output says nothing to me, in the first place, how do you know you're having a problem?. Mesh cutoff refers...
Read more >
hamiltonians bethe-salpeter equation: Topics by Science.gov
There have been numerous efforts in literature to accurately predict IP and EA of liquid water, however with often conflicting results depending on...
Read more >
A first-principles calculation with SIESTA - Z2Pack
import z2pack import sisl import numpy as np import matplotlib.pyplot as plt # Read geometry, Hamiltonian and overlap matrix from SIESTA output using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found