Skip to content

Commit

Permalink
improved prefetching
Browse files Browse the repository at this point in the history
  • Loading branch information
azrael417 committed Jan 12, 2015
1 parent 40fc05d commit 125ab65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions include/qdp_hdf5.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ namespace QDP {
protected:
hid_t error_stack, file_id, file_comm, current_group;
multi1d<int> reordermap;
bool isprefetched;

//Lustre optimizations
long int stripesize, maxalign;
Expand Down
9 changes: 5 additions & 4 deletions lib/qdp_hdf5.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace QDP {

//no profiling
profile=false;
isprefetched=false;

//do not do cleanup after finishing:
herr_t err=H5dont_atexit();
Expand All @@ -35,9 +36,6 @@ namespace QDP {
//get old error handler
H5Eget_auto(error_stack, &oldfunc, &client_data);

//prefetch coordinates for faster I/O:
prefetchCoordinates();

//get new error handler
//H5Eset_auto(error_stack,errorHandler,NULL);
//H5Eset_auto(error_stack,NULL,NULL);
Expand Down Expand Up @@ -1656,7 +1654,7 @@ namespace QDP {
//***********************************************************************************************************************************
//helper routines for Lattice field I/O:
void HDF5Writer::writePrepare(const std::string& name, const HDF5Base::writemode& mode){
//before writing is performed, check if dataset exists:
//before writing is performed, check if dataset exists:
herr_t errhandle;

bool exists=objectExists(current_group,name);
Expand All @@ -1673,6 +1671,9 @@ namespace QDP {
deleteAllAttributes(name);
errhandle=H5Ldelete(current_group,name.c_str(),H5P_DEFAULT);
}

//prefetch for faster I/O:
if(!isprefetched) prefetchCoordinates();
}

void HDF5Writer::writeLattice(const std::string& name, const hid_t& datatype, const ullong& obj_size, char* buf){
Expand Down

0 comments on commit 125ab65

Please sign in to comment.