@@ -357,27 +357,24 @@ Finds the output files for each of the calculations of a [`Job`](@ref), and grou
357357function outputdata (job:: Job ; calcs= map (x-> x. name, job. calculations), extra_parse_funcs= Dict ())
358358 server = Server (job. server)
359359 out = Dict {String, Dict{Symbol, Any}} ()
360- for c in calcs
361- calculation = job[c]
362- p = joinpath (job, calculation. outfile)
363- if ispath (server, p)
364- if Calculations. isprojwfc (calculation)
365- dos_files = filter (x-> any (y-> occursin (string (y. name), x), job. structure. atoms), searchdir (job, " pdos_a" ))
366- extra_files = String[]
367- dir = mkdir (tempname ())
368- for e in dos_files
369- tfp = joinpath (dir, splitpath (e)[end ])
370- write (tfp, read (server, e))
371- push! (extra_files, tfp)
360+ calculations = map (x-> job[x], calcs)
361+ tdir = tempname ()
362+ RemoteHPC. pull (job, tdir, infiles= false , calcs= calculations)
363+ for c in calculations
364+ of = Calculations. outfiles (c)
365+ main_file = joinpath (tdir, of[1 ])
366+ if ispath (main_file)
367+ extra_files = String[]
368+ if length (of) > 1
369+ for f in of[2 : end ]
370+ append! (extra_files, searchdir (tdir, f))
372371 end
373- else
374- extra_files = String[]
375372 end
376373 try
377- out[c] = FileIO. outputdata (calculation , IOBuffer (read (server, p )), extra_files... ; extra_parse_funcs = get (extra_parse_funcs, c, Pair{String}[]))
374+ out[c. name ] = FileIO. outputdata (c , IOBuffer (read (main_file )), extra_files... ; extra_parse_funcs = get (extra_parse_funcs, c. name , Pair{String}[]))
378375 for strkey in (:initial_structure , :final_structure )
379- if haskey (out[c], strkey)
380- for a in out[c][strkey]. atoms
376+ if haskey (out[c. name ], strkey)
377+ for a in out[c. name ][strkey]. atoms
381378 a. pseudo. server = job. server
382379 end
383380 end
0 commit comments