From 376d9b36937d76a12f5d9431ce18427668908378 Mon Sep 17 00:00:00 2001 From: Priyanka Seth Date: Wed, 19 Nov 2014 18:50:53 +0100 Subject: [PATCH] Fix #23 : repack error, add path to hdf5 --- python/converters/converter_tools.py | 7 ++++--- python/converters/hk_converter.py | 2 +- python/converters/wien2k_converter.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/python/converters/converter_tools.py b/python/converters/converter_tools.py index 04515c60..bd435656 100644 --- a/python/converters/converter_tools.py +++ b/python/converters/converter_tools.py @@ -19,6 +19,7 @@ # TRIQS. If not, see . # ################################################################################ +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]) diff --git a/python/converters/hk_converter.py b/python/converters/hk_converter.py index be0a67ea..7c7ef3c5 100644 --- a/python/converters/hk_converter.py +++ b/python/converters/hk_converter.py @@ -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): diff --git a/python/converters/wien2k_converter.py b/python/converters/wien2k_converter.py index 845933ec..89fa221f 100644 --- a/python/converters/wien2k_converter.py +++ b/python/converters/wien2k_converter.py @@ -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):