Skip to content

Commit

Permalink
hp parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
louisponet committed Mar 10, 2023
1 parent 1016eaf commit a0f8fa1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/Client/job.jl
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,14 @@ function outputdata(job::Job; calcs=map(x->x.name, job.calculations), extra_pars
server = Server(job.server)
out = Dict{String, Dict{Symbol, Any}}()
calculations = map(x->job[x], calcs)
tdir = tempname()
RemoteHPC.pull(job, tdir, infiles=false, calcs=calculations)

if !Jobs.runslocal(job)
tdir = tempname()
RemoteHPC.pull(job, tdir, infiles=false, calcs=calculations)
else
tdir = job.dir
end

for c in calculations
of = Calculations.outfiles(c)
main_file = joinpath(tdir, of[1])
Expand Down
12 changes: 11 additions & 1 deletion src/FileIO/qe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -903,8 +903,18 @@ function qe_parse_Hubbard_U(out, line, f)
end
end

function qe_parse_HP_error(out, line, f)
out[:error] = true
while !occursin("E_Fermi", line)
line = readline(f)
end
fermi_dos = parse(Float64, split(line)[end])
out[:fermi_dos] = fermi_dos
end

const QE_HP_PARSE_FUNCS = ["will be perturbed" => qe_parse_pert_at,
"Hubbard U parameters:" => qe_parse_Hubbard_U]
"Hubbard U parameters:" => qe_parse_Hubbard_U,
"WARNING: The Fermi energy shift is zero or too big!" => qe_parse_HP_error]

function qe_parse_hp_output(hp_file, hubbard_files...; parse_funcs = Pair{String,<:Function}[])
out = parse_file(hp_file, QE_HP_PARSE_FUNCS; extra_parse_funcs = parse_funcs)
Expand Down

2 comments on commit a0f8fa1

@louisponet
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/79360

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.5.29 -m "<description of version>" a0f8fa13f4bf364da9b22ee2cf1fe7dc05e57b78
git push origin v0.5.29

Please sign in to comment.