Commit 10bdd8ed authored by gsell's avatar gsell

H5hut >= 2 is now required

parent 80c1a9e8
......@@ -133,10 +133,6 @@ IF (BUILD_OPAL_UNIT_TESTS)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_UNIT_TESTS")
ENDIF (BUILD_OPAL_UNIT_TESTS)
IF (USE_H5HUT2)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_H5HUT2")
ENDIF (USE_H5HUT2)
IF (ENABLE_AMR)
MESSAGE (STATUS "Enable AMR_SOLVER " ${ENABLE_AMR})
......
......@@ -39,14 +39,13 @@ SET (CMAKE_REQUIRED_INCLUDES ${H5Hut_INCLUDE_DIR})
CHECK_INCLUDE_FILE (H5_file_attribs.h HAVE_API2_FUNCTIONS "-I${H5Hut_INCLUDE_DIR} -DPARALLEL_IO")
IF (HAVE_API2_FUNCTIONS)
MESSAGE (STATUS "H5hut version is >= 2")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_H5HUT2")
MESSAGE (STATUS "H5hut version is OK")
ELSE (HAVE_API2_FUNCTIONS)
MESSAGE (STATUS "H5hut version is 1.x")
MESSAGE (ERROR "H5hut >= 2 required")
ENDIF (HAVE_API2_FUNCTIONS)
# Local Variables:
# mode:cmake
# cmake-tab-width: 4
# indent-tabs-mode:nil
# End:
\ No newline at end of file
# End:
......@@ -18,8 +18,6 @@ H5Reader::H5Reader()
void H5Reader::open(int step) {
close();
#if defined (USE_H5HUT2)
h5_prop_t props = H5CreateFileProp ();
MPI_Comm comm = Ippl::getComm();
h5_err_t h5err = H5SetPropFileMPIOCollective (props, &comm);
......@@ -29,10 +27,6 @@ void H5Reader::open(int step) {
assert (h5err != H5_ERR);
file_m = H5OpenFile (filename_m.c_str(), H5_O_RDONLY, props);
assert (file_m != (h5_file_t)H5_ERR);
#else
file_m = H5OpenFile(filename_m.c_str(), H5_FLUSH_STEP | H5_O_RDONLY, Ippl::getComm());
assert (file_m != (void*)H5_ERR);
#endif
H5SetStep(file_m, step);
}
......@@ -135,7 +129,7 @@ void H5Reader::writeScalarField(const container_t& scalfield,
h5_file_t file = 0;
std::string fname = "test_scalfield.h5";
#if defined (USE_H5HUT2)
h5_prop_t props = H5CreateFileProp ();
MPI_Comm comm = Ippl::getComm(); // ParallelDescriptor::m_comm_all; //
h5_err_t h5err = H5SetPropFileMPIOIndependent(props, &comm);
......@@ -146,10 +140,6 @@ void H5Reader::writeScalarField(const container_t& scalfield,
assert (h5err != H5_ERR);
file = H5OpenFile (fname.c_str(), H5_O_WRONLY, props);
assert (file != (h5_file_t)H5_ERR);
#else
file = H5OpenFile(fname.c_str(), H5_O_WRONLY, Ippl::getComm()); // ParallelDescriptor::m_comm_all);
assert (file != (void*)H5_ERR);
#endif
H5SetStep (file, 0);
......@@ -252,4 +242,4 @@ void H5Reader::writeScalarField(const container_t& scalfield,
void H5Reader::writeVectorField(const container_t& vecfield) {
}
\ No newline at end of file
}
......@@ -84,12 +84,7 @@ public:
private:
std::string filename_m; ///< Path and filename
#if defined (USE_H5HUT2)
h5_file_t file_m; ///< Opened file
#else
h5_file_t *file_m;
#endif
};
#endif
\ No newline at end of file
#endif
......@@ -11,7 +11,7 @@ message (STATUS "The MPI C++ compiler is: ${MPI_CXX_COMPILER}")
set (CMAKE_CXX_FLAGS "-O3 ${CMAKE_CXX_FLAGS} -DBL_USE_FORTRAN_MPI")
set (CMAKE_CXX_FLAGS
"${IPPL_CMAKE_CXX_FLAGS} -std=c++11 -DUSEH5FEDV2 -DPARALLEL_IO ${CMAKE_CXX_FLAGS}"
"${IPPL_CMAKE_CXX_FLAGS} -std=c++11 -DPARALLEL_IO ${CMAKE_CXX_FLAGS}"
)
include_directories (
......
......@@ -13,7 +13,7 @@ set (CMAKE_CXX_FLAGS
)
set (CMAKE_CXX_FLAGS
"${IPPL_CMAKE_CXX_FLAGS} -std=c++11 -DUSEH5FEDV2 -DPARALLEL_IO -DIPPL_AMR ${AMREX_DEFINES} ${CMAKE_CXX_FLAGS}"
"${IPPL_CMAKE_CXX_FLAGS} -std=c++11 -DPARALLEL_IO -DIPPL_AMR ${AMREX_DEFINES} ${CMAKE_CXX_FLAGS}"
)
set (BOOSTROOT $ENV{BOOST_DIR})
......
......@@ -13,7 +13,7 @@ set (CMAKE_CXX_FLAGS
)
set (CMAKE_CXX_FLAGS
"${IPPL_CMAKE_CXX_FLAGS} -std=c++11 -DUSEH5FEDV2 -DPARALLEL_IO -DIPPL_AMR ${AMREX_DEFINES} ${CMAKE_CXX_FLAGS}"
"${IPPL_CMAKE_CXX_FLAGS} -std=c++11 -DPARALLEL_IO -DIPPL_AMR ${AMREX_DEFINES} ${CMAKE_CXX_FLAGS}"
)
include_directories (
......
......@@ -13,7 +13,7 @@ link_directories (
)
set (CMAKE_CXX_FLAGS
"${IPPL_CMAKE_CXX_FLAGS} -std=c++11 -DUSEH5FEDV2 -DPARALLEL_IO ${CMAKE_CXX_FLAGS}"
"${IPPL_CMAKE_CXX_FLAGS} -std=c++11 -DPARALLEL_IO ${CMAKE_CXX_FLAGS}"
)
SET (IPPL_LIBS ippl)
......
......@@ -473,17 +473,12 @@ public:
}
void openH5(std::string fn){
#if defined (USE_H5HUT2)
h5_prop_t props = H5CreateFileProp ();
MPI_Comm comm = Ippl::getComm();
h5_err_t h5err = H5SetPropFileMPIOCollective (props, &comm);
assert (h5err != H5_ERR);
H5f_m = H5OpenFile (fn.c_str(), H5_O_RDONLY, props);
assert (H5f_m != (h5_file_t)H5_ERR);
#else
H5f_m = H5OpenFile(fn.c_str(), H5_FLUSH_STEP | H5_O_WRONLY, Ippl::getComm());
assert (H5f_m != (void*)H5_ERR);
#endif
}
......@@ -537,11 +532,7 @@ public:
//TEMP debug variable
double RhoSum=0;
#if defined (USE_H5HUT2)
h5_file_t H5f_m;
#else
h5_file_t *H5f_m;
#endif
double temperature[Dim];
double avg_vel[Dim];
......
......@@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.8.10)
set (DKS_VERSION_OPAL \"${DKS_VERSION}\")
set (CMAKE_CXX_FLAGS
"${IPPL_CMAKE_CXX_FLAGS} -DUSEH5FEDV2 -DPARALLEL_IO ${CMAKE_CXX_FLAGS}"
"${IPPL_CMAKE_CXX_FLAGS} -DPARALLEL_IO ${CMAKE_CXX_FLAGS}"
)
IF(ENABLE_SAAMG_SOLVER)
......@@ -164,4 +164,4 @@ install (FILES ${HDRS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/src")
# mode:cmake
# cmake-tab-width: 4
# indent-tabs-mode:nil
# End:
\ No newline at end of file
# End:
......@@ -25,17 +25,12 @@ FM3DH5Block::FM3DH5Block(std::string aFilename):Fieldmap(aFilename) {
Type = T3DDynamicH5Block;
#if defined (USE_H5HUT2)
h5_prop_t props = H5CreateFileProp ();
MPI_Comm comm = Ippl::getComm();
h5err = H5SetPropFileMPIOCollective (props, &comm);
assert (h5err != H5_ERR);
h5_file_t file = H5OpenFile (aFilename.c_str(), H5_O_RDONLY, props);
assert (file != (h5_file_t)H5_ERR);
#else
h5_file_t *file = H5OpenFile (aFilename.c_str(), H5_O_RDONLY, Ippl::getComm());
assert (file != (void*)H5_ERR);
#endif
h5_int64_t last_step = H5GetNumSteps(file) - 1;
assert (last_step >= 0);
......@@ -87,17 +82,12 @@ void FM3DH5Block::readMap() {
#if defined (NDEBUG)
(void)h5err;
#endif
#if defined (USE_H5HUT2)
h5_prop_t props = H5CreateFileProp ();
MPI_Comm comm = Ippl::getComm();
h5err = H5SetPropFileMPIOCollective (props, &comm);
assert (h5err != H5_ERR);
h5_file_t file = H5OpenFile (Filename_m.c_str(), H5_O_RDONLY, props);
assert (file != (h5_file_t)H5_ERR);
#else
h5_file_t *file = H5OpenFile (Filename_m.c_str(), H5_O_RDONLY, Ippl::getComm());
assert (file != (void*)H5_ERR);
#endif
long field_size = 0;
int Nnodes = Ippl::getNodes();
......
......@@ -25,17 +25,12 @@ FM3DH5Block_nonscale::FM3DH5Block_nonscale(std::string aFilename):
Type = T3DDynamicH5Block;
#if defined (USE_H5HUT2)
h5_prop_t props = H5CreateFileProp ();
MPI_Comm comm = Ippl::getComm();
h5err = H5SetPropFileMPIOCollective (props, &comm);
assert (h5err != H5_ERR);
h5_file_t file = H5OpenFile (aFilename.c_str(), H5_O_RDONLY, props);
assert (file != (h5_file_t)H5_ERR);
#else
h5_file_t *file = H5OpenFile (aFilename.c_str(), H5_O_RDONLY, Ippl::getComm());
assert (file != (void*)H5_ERR);
#endif
h5_int64_t last_step = H5GetNumSteps(file) - 1;
assert (last_step >= 0);
......@@ -91,17 +86,12 @@ void FM3DH5Block_nonscale::readMap() {
#if defined (NDEBUG)
(void)h5err;
#endif
#if defined (USE_H5HUT2)
h5_prop_t props = H5CreateFileProp ();
MPI_Comm comm = Ippl::getComm();
h5err = H5SetPropFileMPIOCollective (props, &comm);
assert (h5err != H5_ERR);
h5_file_t file = H5OpenFile (Filename_m.c_str(), H5_O_RDONLY, props);
assert (file != (h5_file_t)H5_ERR);
#else
h5_file_t *file = H5OpenFile (Filename_m.c_str(), H5_O_RDONLY, Ippl::getComm());
assert (file != (void*)H5_ERR);
#endif
long field_size = 0;
int Nnodes = Ippl::getNodes();//min(20, Ippl::getNodes());
......
......@@ -25,17 +25,12 @@ FM3DMagnetoStaticH5Block::FM3DMagnetoStaticH5Block(string aFilename):
Type = T3DMagnetoStaticH5Block;
#if defined (USE_H5HUT2)
h5_prop_t props = H5CreateFileProp ();
MPI_Comm comm = Ippl::getComm();
h5err = H5SetPropFileMPIOCollective (props, &comm);
assert (h5err != H5_ERR);
h5_file_t file = H5OpenFile (aFilename.c_str(), H5_O_RDONLY, props);
assert (file != (h5_file_t)H5_ERR);
#else
h5_file_t *file = H5OpenFile (aFilename.c_str(), H5_O_RDONLY, Ippl::getComm());
assert (file != (void*)H5_ERR);
#endif
h5_int64_t last_step = H5GetNumSteps(file) - 1;
assert (last_step >= 0);
......@@ -94,17 +89,12 @@ void FM3DMagnetoStaticH5Block::readMap() {
(void)h5err;
#endif
#if defined (USE_H5HUT2)
h5_prop_t props = H5CreateFileProp ();
MPI_Comm comm = Ippl::getComm();
h5err = H5SetPropFileMPIOCollective (props, &comm);
assert (h5err != H5_ERR);
h5_file_t file = H5OpenFile (Filename_m.c_str(), H5_O_RDONLY, props);
assert (file != (h5_file_t)H5_ERR);
#else
h5_file_t *file = H5OpenFile (Filename_m.c_str(), H5_O_RDONLY, Ippl::getComm());
assert (file != (void*)H5_ERR);
#endif
long field_size = 0;
int Nnodes = Ippl::getNodes();//min(20, Ippl::getNodes());
......
......@@ -360,17 +360,12 @@ MapType Fieldmap::readHeader(std::string Filename) {
#endif
char name[20];
h5_size_t len_name = sizeof(name);
#if defined (USE_H5HUT2)
h5_prop_t props = H5CreateFileProp ();
MPI_Comm comm = Ippl::getComm();
h5err = H5SetPropFileMPIOCollective (props, &comm);
assert (h5err != H5_ERR);
h5_file_t file = H5OpenFile (Filename.c_str(), H5_O_RDONLY, props);
assert (file != (h5_file_t)H5_ERR);
#else
h5_file_t *file = H5OpenFile (Filename.c_str(), H5_O_RDONLY, Ippl::getComm());
assert (file != (void*)H5_ERR);
#endif
h5err = H5SetStep(file, 0);
assert (h5err != H5_ERR);
......@@ -805,4 +800,4 @@ REGISTER_PARSE_TYPE(std::string);
std::string Fieldmap::alpha_numeric("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-+\211");
std::map<std::string, Fieldmap::FieldmapDescription> Fieldmap::FieldmapDictionary = std::map<std::string, Fieldmap::FieldmapDescription>();
char Fieldmap::buffer_m[READ_BUFFER_LENGTH];
\ No newline at end of file
char Fieldmap::buffer_m[READ_BUFFER_LENGTH];
......@@ -76,7 +76,6 @@ LossDataSink::~LossDataSink() {
}
void LossDataSink::openH5(h5_int32_t mode) {
#if defined (USE_H5HUT2)
h5_prop_t props = H5CreateFileProp ();
MPI_Comm comm = Ippl::getComm();
H5SetPropFileMPIOCollective (props, &comm);
......@@ -86,14 +85,6 @@ void LossDataSink::openH5(h5_int32_t mode) {
throw GeneralClassicException("LossDataSink::openH5",
"failed to open h5 file '" + fn_m + "'");
}
#else
H5file_m = H5OpenFile(fn_m.c_str(), mode, Ippl::getComm());
if(H5file_m == (void*)H5_ERR) {
throw GeneralClassicException("LossDataSink::openH5",
"failed to open h5 file '" + fn_m + "'");
}
#endif
}
void LossDataSink::writeHeaderH5() {
......
......@@ -100,11 +100,7 @@ private:
bool h5hut_mode_m;
/// H5 file for particle data.
#if defined (USE_H5HUT2)
h5_file_t H5file_m;
#else
h5_file_t *H5file_m;
#endif
/// Current record, or time step, of H5 file.
h5_int64_t H5call_m;
......@@ -143,4 +139,4 @@ void LossDataSink::reportOnError(h5_int64_t rc, const char* file, int line) {
ERRORMSG("H5 rc= " << rc << " in " << file << " @ line " << line << endl);
}
#endif
\ No newline at end of file
#endif
......@@ -1730,14 +1730,10 @@ Change orientation if diff is:
assert (rc != H5_ERR);
H5SetVerbosityLevel (1);
#if defined (USE_H5HUT2)
h5_prop_t props = H5CreateFileProp ();
MPI_Comm comm = Ippl::getComm();
H5SetPropFileMPIOCollective (props, &comm);
h5_file_t f = H5OpenFile (h5FileName_m.c_str(), H5_O_RDONLY, props);
#else
h5_file_t *f = H5OpenFile (h5FileName_m.c_str(), H5_O_RDONLY, Ippl::getComm());
#endif
h5t_mesh_t* m = NULL;
H5FedOpenTriangleMesh (f, "0", &m);
......@@ -2602,4 +2598,4 @@ void BoundaryGeometry::createPriPart (
// mode:c
// c-basic-offset: 4
// indent-tabs-mode:nil
// End:
\ No newline at end of file
// End:
......@@ -1003,7 +1003,6 @@ void DataSink::writeSurfaceInteraction(PartBunchBase<double, 3> *beam, long long
if(firstWriteH5Surface_m) {
firstWriteH5Surface_m = false;
#if defined (USE_H5HUT2)
h5_prop_t props = H5CreateFileProp ();
MPI_Comm comm = Ippl::getComm();
H5SetPropFileMPIOCollective (props, &comm);
......@@ -1012,13 +1011,6 @@ void DataSink::writeSurfaceInteraction(PartBunchBase<double, 3> *beam, long long
throw OpalException("DataSink::writeSurfaceInteraction",
"failed to open h5 file '" + surfaceLossFileName_m + "' for surface loss");
}
#else
H5fileS_m = H5OpenFile(surfaceLossFileName_m.c_str(), H5_FLUSH_STEP | H5_O_WRONLY, Ippl::getComm());
if(H5fileS_m == (void*)H5_ERR) {
throw OpalException("DataSink::writeSurfaceInteraction",
"failed to open h5 file '" + surfaceLossFileName_m + "' for surface loss");
}
#endif
}
int nTot = bg.getNumBFaces();
......@@ -1520,4 +1512,4 @@ void DataSink::writeMemoryData(PartBunchBase<double, 3> *beam,
/***************************************************************************
* $RCSfile: DataSink.cpp,v $ $Author: adelmann $
* $Revision: 1.3 $ $Date: 2004/06/02 19:38:54 $
***************************************************************************/
\ No newline at end of file
***************************************************************************/
......@@ -264,11 +264,7 @@ private:
std::string surfaceLossFileName_m;
/// H5 file for surface loss data.
#if defined (USE_H5HUT2)
h5_file_t H5fileS_m;
#else
h5_file_t *H5fileS_m;
#endif
/// Current record, or time step, of H5 file.
int H5call_m;
......@@ -332,4 +328,4 @@ std::string DataSink::convertToString(int number) {
/***************************************************************************
* $RCSfile: DataSink.h,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 13:29:44 $
***************************************************************************/
\ No newline at end of file
***************************************************************************/
......@@ -16,19 +16,11 @@
extern Inform *gmsg;
namespace {
#if defined (USE_H5HUT2)
const h5_int64_t H5TypesCHAR = H5_STRING_T;
const h5_int64_t H5TypesFLOAT = H5_FLOAT32_T;
const h5_int64_t H5TypesDOUBLE = H5_FLOAT64_T;
const h5_int64_t H5TypesINT32 = H5_INT32_T;
const h5_int64_t H5TypesINT64 = H5_INT64_T;
#else
const h5_int64_t H5TypesCHAR = H5T_NATIVE_CHAR;
const h5_int64_t H5TypesFLOAT = H5T_NATIVE_FLOAT;
const h5_int64_t H5TypesDOUBLE = H5T_NATIVE_DOUBLE;
const h5_int64_t H5TypesINT32 = H5T_NATIVE_INT32;
const h5_int64_t H5TypesINT64 = H5T_NATIVE_INT64;
#endif
}
std::string H5PartWrapper::copyFilePrefix_m = ".copy";
......@@ -76,7 +68,6 @@ void H5PartWrapper::close() {
void H5PartWrapper::open(h5_int32_t flags) {
close();
#if defined (USE_H5HUT2)
h5_prop_t props = H5CreateFileProp ();
MPI_Comm comm = Ippl::getComm();
h5_err_t h5err = H5SetPropFileMPIOCollective (props, &comm);
......@@ -86,12 +77,6 @@ void H5PartWrapper::open(h5_int32_t flags) {
assert (h5err != H5_ERR);
file_m = H5OpenFile (fileName_m.c_str(), flags, props);
assert (file_m != (h5_file_t)H5_ERR);
#else
file_m = H5OpenFile(fileName_m.c_str(), H5_FLUSH_STEP | flags, Ippl::getComm());
assert (file_m != (void*)H5_ERR);
#endif
}
void H5PartWrapper::storeCavityInformation() {
......@@ -99,18 +84,10 @@ void H5PartWrapper::storeCavityInformation() {
h5_int64_t nAutopPhaseCavities = OpalData::getInstance()->getNumberOfMaxPhases();
h5_int64_t nFormerlySavedAutoPhaseCavities = 0;
#ifdef USE_H5HUT2
if (!H5HasFileAttrib(file_m, "nAutoPhaseCavities") ||
H5ReadFileAttribInt64(file_m, "nAutoPhaseCavities", &nFormerlySavedAutoPhaseCavities) != H5_SUCCESS) {
nFormerlySavedAutoPhaseCavities = 0;
}
#else
H5SetErrorHandler(H5ReportErrorhandler);
if (H5ReadFileAttribInt64(file_m, "nAutoPhaseCavities", &nFormerlySavedAutoPhaseCavities) != H5_SUCCESS) {
nFormerlySavedAutoPhaseCavities = 0;
}
H5SetErrorHandler(H5AbortErrorhandler);
#endif
if (nFormerlySavedAutoPhaseCavities == nAutopPhaseCavities) return;
WRITEFILEATTRIB(Int64, file_m, "nAutoPhaseCavities", &nAutopPhaseCavities, 1);
......@@ -145,7 +122,6 @@ void H5PartWrapper::copyFile(const std::string &sourceFile, int lastStep, h5_int
}
if (sourceFile == fileName_m) {
#if defined (USE_H5HUT2)
h5_prop_t props = H5CreateFileProp ();
MPI_Comm comm = Ippl::getComm();
h5_err_t h5err = H5SetPropFileMPIOCollective (props, &comm);
......@@ -155,10 +131,6 @@ void H5PartWrapper::copyFile(const std::string &sourceFile, int lastStep, h5_int
assert (h5err != H5_ERR);
h5_file_t source = H5OpenFile (sourceFile.c_str(), H5_O_RDONLY, props);
assert (source != (h5_file_t)H5_ERR);
#else
h5_file_t *source = H5OpenFile(sourceFile.c_str(), H5_FLUSH_STEP | H5_O_RDONLY, Ippl::getComm());
assert (source != (void*)H5_ERR);
#endif
h5_ssize_t numStepsInSource = H5GetNumSteps(source);
if (lastStep == -1 || lastStep >= numStepsInSource) {
......@@ -186,17 +158,12 @@ void H5PartWrapper::copyFile(const std::string &sourceFile, int lastStep, h5_int
Ippl::Comm->barrier();
open(flags);
#if defined (USE_H5HUT2)
props = H5CreateFileProp ();
comm = Ippl::getComm();
h5err = H5SetPropFileMPIOCollective (props, &comm);
assert (h5err != H5_ERR);
source = H5OpenFile (sourceFileName.c_str(), H5_O_RDONLY, props);
assert (source != (h5_file_t)H5_ERR);
#else
source = H5OpenFile(sourceFileName.c_str(), H5_FLUSH_STEP | H5_O_RDONLY, Ippl::getComm());
assert (source != (void*)H5_ERR);
#endif
copyHeader(source);
if (lastStep < 0) {
......@@ -222,7 +189,6 @@ void H5PartWrapper::copyFile(const std::string &sourceFile, int lastStep, h5_int
open(flags);
#if defined (USE_H5HUT2)
h5_prop_t props = H5CreateFileProp ();
MPI_Comm comm = Ippl::getComm();
h5_err_t h5err = H5SetPropFileMPIOCollective (props, &comm);
......@@ -232,10 +198,6 @@ void H5PartWrapper::copyFile(const std::string &sourceFile, int lastStep, h5_int
assert (h5err != H5_ERR);
h5_file_t source = H5OpenFile (sourceFile.c_str(), H5_O_RDONLY, props);
assert (source != (h5_file_t)H5_ERR);
#else
h5_file_t *source = H5OpenFile(sourceFile.c_str(), H5_FLUSH_STEP | H5_O_RDONLY, Ippl::getComm());
assert (source != (void*)H5_ERR);
#endif
h5_ssize_t numStepsInSource = H5GetNumSteps(source);
if (lastStep == -1 || lastStep >= numStepsInSource) {
......@@ -311,11 +273,7 @@ void H5PartWrapper::copyFileSystem(const std::string &sourceFile) {
}
void H5PartWrapper::copyHeader(
#if defined (USE_H5HUT2)
h5_file_t source
#else
h5_file_t *source
#endif
) {
h5_int64_t numFileAttributes = H5GetNumFileAttribs(source);
......@@ -385,11 +343,7 @@ void H5PartWrapper::copyHeader(
}
void H5PartWrapper::copyStep(
#if defined (USE_H5HUT2)
h5_file_t source,
#else
h5_file_t *source,
#endif
int step
) {
REPORTONERROR(H5SetStep(file_m, numSteps_m));
......@@ -400,11 +354,7 @@ void H5PartWrapper::copyStep(
}
void H5PartWrapper::copyStepHeader(
#if defined (USE_H5HUT2)
h5_file_t source
#else
h5_file_t *source
#endif
) {
h5_int64_t numStepAttributes = H5GetNumStepAttribs(source);
......@@ -478,11 +428,7 @@ void H5PartWrapper::copyStepHeader(
}
void H5PartWrapper::copyStepData(
#if defined (USE_H5HUT2)
h5_file_t source
#else
h5_file_t *source
#endif
) {
h5_size_t lengthSetName = 256;
char setName[lengthSetName];
......@@ -576,4 +522,4 @@ size_t H5PartWrapper::getNumParticles() const {
// mode:c++
// c-basic-offset: 4
// indent-tabs-mode:nil
// End:
\ No newline at end of file
// End:
......@@ -53,17 +53,10 @@ protected:
void copyFile(const std::string &sourceFile, int lastStep = -1, h5_int32_t flags = H5_O_WRONLY);
void copyFileSystem(const std::string &sourceFile);
#if defined (USE_H5HUT2)
void copyHeader(h5_file_t source);
void copyStep(h5_file_t source, int step);
void copyStepHeader(h5_file_t source);
void copyStepData(h5_file_t source);
#else
void copyHeader(h5_file_t *source);
void copyStep(h5_file_t *source, int step);
void copyStepHeader(h5_file_t *source);
void copyStepData(h5_file_t *source);
#endif
void sendFailureMessage(bool failed,
const std::string &where,
const std::string &what);
......@@ -73,11 +66,7 @@ protected:
static void reportOnError(h5_int64_t rc, const char* file, int line);
#if defined (USE_H5HUT2)
h5_file_t file_m;
#else
h5_file_t *file_m;
#endif
std::string fileName_m;
std::string predecessorOPALFlavour_m;
h5_int64_t numSteps_m;
......
......@@ -70,20 +70,10 @@ void H5PartWrapperForPS::readHeader() {
auto opal = OpalData::getInstance();
h5_float64_t phase;
h5_int64_t numAutoPhaseCavities;
#ifdef USE_H5HUT2
if (!H5HasFileAttrib(file_m, "nAutoPhaseCavities") ||
H5ReadFileAttribInt64(file_m, "nAutoPhaseCavities", &numAutoPhaseCavities) != H5_SUCCESS) {
numAutoPhaseCavities = 0;
}
#else
H5SetErrorHandler(H5ReportErrorhandler);
h5_int64_t rc = H5ReadFileAttribInt64(file_m, "nAutoPhaseCavities", &numAutoPhaseCavities);
H5SetErrorHandler(H5AbortErrorhandler);
if (rc != H5_SUCCESS) {
numAutoPhaseCavities = 0;
}
#endif
else {
} else {
for(long i = 0; i < numAutoPhaseCavities; ++ i) {
std::string elementName = "Cav-" + std::to_string(i + 1) + "-name";
std::string elementPhase = "Cav-" + std::to_string(i + 1) + "-value";
......
......@@ -69,20 +69,10 @@ void H5PartWrapperForPT::readHeader() {
auto opal = OpalData::getInstance();
h5_float64_t phase;
h5_int64_t numAutoPhaseCavities = 0;
#ifdef USE_H5HUT2
if (!H5HasFileAttrib(file_m, "nAutoPhaseCavities") ||
H5ReadFileAttribInt64(file_m, "nAutoPhaseCavities", &numAutoPhaseCavities) != H5_SUCCESS) {
numAutoPhaseCavities = 0;
}
#else
H5SetErrorHandler(H5ReportErrorhandler);
h5_int64_t rc = H5ReadFileAttribInt64(file_m, "nAutoPhaseCavities", &numAutoPhaseCavities);
H5SetErrorHandler(H5AbortErrorhandler);
if (rc != H5_SUCCESS) {
numAutoPhaseCavities = 0;
}
#endif
else {
} else {
for(long i = 0; i < numAutoPhaseCavities; ++ i) {
std::string elementName = "Cav-" + std::to_string(i + 1) + "-name";
std::string elementPhase = "Cav-" + std::to_string(i + 1) + "-value";
......
......@@ -5,7 +5,7 @@ set (TEST_EXE opal_unit_tests)
set (SRC_DIRS classic_src opal_src)
set (CMAKE_CXX_FLAGS
"${IPPL_CMAKE_CXX_FLAGS} -DUSEH5FEDV2 -DPARALLEL_IO ${CMAKE_CXX_FLAGS} -DWITH_UNIT_TESTS"
"${IPPL_CMAKE_CXX_FLAGS} -DPARALLEL_IO ${CMAKE_CXX_FLAGS} -DWITH_UNIT_TESTS"
)
set (TEST_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
......
......@@ -6,7 +6,7 @@ SET (OPAL2SDDS_VERSION_MINOR 1)
configure_file(config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
set (CMAKE_CXX_FLAGS
"${IPPL_CMAKE_CXX_FLAGS} -DUSEH5FEDV2 -DPARALLEL_IO ${CMAKE_CXX_FLAGS}"
"${IPPL_CMAKE_CXX_FLAGS} -DPARALLEL_IO ${CMAKE_CXX_FLAGS}"
)
INCLUDE_DIRECTORIES (
......@@ -34,4 +34,4 @@ SET (SDDS_LIBS
ADD_EXECUTABLE( opal2sdds main.cpp )
TARGET_LINK_LIBRARIES( opal2sdds ${SDDS_LIBS} )
INSTALL(TARGETS opal2sdds RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
\ No newline at end of file
INSTALL(TARGETS opal2sdds RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
......@@ -35,11 +35,7 @@ enum FORMAT {
ASCII = SDDS_ASCII
};