3
0
mirror of https://github.com/triqs/dft_tools synced 2024-06-14 09:15:32 +02:00

Fix #23 : repack error, add path to hdf5

This commit is contained in:
Priyanka Seth 2014-11-19 18:50:53 +01:00
parent be69c7345b
commit 376d9b3693
3 changed files with 6 additions and 5 deletions

View File

@ -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])

View 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):

View File

@ -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):