mirror of
https://github.com/triqs/dft_tools
synced 2025-01-03 01:55:56 +01:00
Fix #23 : repack error, add path to hdf5
This commit is contained in:
parent
be69c7345b
commit
376d9b3693
@ -19,6 +19,7 @@
|
||||
# TRIQS. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
################################################################################
|
||||
from pytriqs.cmake_info import hdf5_command_path
|
||||
|
||||
class ConverterTools:
|
||||
|
||||
@ -32,7 +33,7 @@ class ConverterTools:
|
||||
for x in line.split(): yield string.atof(x)
|
||||
|
||||
|
||||
def __repack(self):
|
||||
def repack(self):
|
||||
"""Calls the h5repack routine, in order to reduce the file size of the hdf5 archive.
|
||||
Should only be used BEFORE the first invokation of HDFArchive in the program, otherwise
|
||||
the hdf5 linking is broken!!!"""
|
||||
@ -42,8 +43,8 @@ class ConverterTools:
|
||||
if not (mpi.is_master_node()): return
|
||||
mpi.report("Repacking the file %s"%self.hdf_file)
|
||||
|
||||
retcode = subprocess.call(["h5repack","-i%s"%self.hdf_file, "-otemphgfrt.h5"])
|
||||
if (retcode!=0):
|
||||
retcode = subprocess.call([hdf5_command_path+"/h5repack","-i%s"%self.hdf_file,"-otemphgfrt.h5"])
|
||||
if retcode != 0:
|
||||
mpi.report("h5repack failed!")
|
||||
else:
|
||||
subprocess.call(["mv","-f","temphgfrt.h5","%s"%self.hdf_file])
|
||||
|
@ -47,7 +47,7 @@ class HkConverter(ConverterTools):
|
||||
# Checks if h5 file is there and repacks it if wanted:
|
||||
import os.path
|
||||
if (os.path.exists(self.hdf_file) and repacking):
|
||||
ConverterTools.__repack(self)
|
||||
ConverterTools.repack(self)
|
||||
|
||||
|
||||
def convert_dmft_input(self, first_real_part_matrix = True, only_upper_triangle = False, weights_in_file = False):
|
||||
|
@ -57,7 +57,7 @@ class Wien2kConverter(ConverterTools):
|
||||
# Checks if h5 file is there and repacks it if wanted:
|
||||
import os.path
|
||||
if (os.path.exists(self.hdf_file) and repacking):
|
||||
ConverterTools.__repack(self)
|
||||
ConverterTools.repack(self)
|
||||
|
||||
|
||||
def convert_dmft_input(self):
|
||||
|
Loading…
Reference in New Issue
Block a user