VertexBufferNumeric1D_HDF5.hpp
Go to the documentation of this file.
118 virtual void write_external_to_disk(const T (&values)[CHUNKLENGTH], const bool (&isvalid)[CHUNKLENGTH]); 136 if(this->myRank==0 or not this->MPI_mode()) // Only the master process has access to this information, unless we are in non-MPI mode 142 errmsg << "rank "<<this->myRank<<": Error! Validity and Data datasets have gone out of sync in buffer with label '"<<this->get_label()<<"'! This is a bug in the VertexBufferNumeric1D_HDF5 class. Please report it."; 206 errmsg << "rank "<<this->myRank<<": Error! Tried to create buffer '"<<this->get_label()<<"', but supplied HDF5 location pointer was -1 (and we are the rank 0 process, who needs this pointer)"; 223 logger()<<std::endl<<LogTags::printers<<"Attempting to resume writing to dataset '"<<name<<"'..."; 264 errmsg << "rank "<<this->myRank<<": Error! Tried to create buffer '"<<this->get_label()<<"', but supplied HDF5 location pointer was NULL (and we are the rank 0 process, who needs this pointer)"; 277 _dsetvalid = DataSetInterfaceScalar<bool,CHUNKLENGTH>(location_id, name+"_isvalid", resume, this->access_mode()); 281 logger()<<std::endl<<LogTags::printers<<"Attempting to resume writing to dataset '"<<name<<"'..."; 287 _dsetdata = DataSetInterfaceScalar<T,CHUNKLENGTH>(location_id, name, resume, this->access_mode()); 310 std::cout<<"rank "<<this->myRank<<": Begin sync report for buffer "<<this->get_label()<<std::endl; 317 std::cout<<"rank "<<this->myRank<<": End sync report for buffer "<<this->get_label()<<std::endl; 330 errmsg << "rank "<<this->myRank<<": Error! VertexBuffer (HDF5 type) in non-master process tried to access dsetvalid! This doesn't exist except on the master process (buffer is "<<this->get_label()<<")"; 344 errmsg << "rank "<<this->myRank<<"Error! VertexBuffer (HDF5 type) in non-master process tried to access dsetdata! This doesn't exist except on the master process (buffer is "<<this->get_label()<<")"; 371 errmsg << "rank "<<this->myRank<<": Error! Tried to write_to_disk() synchronised write buffer of buffer with name "<<this->get_label()<<", but buffer is not flagged as running in synchronised mode! Please report this bug."; 378 void VertexBufferNumeric1D_HDF5<T,CHUNKLENGTH>::write_external_to_disk(const T (&values)[CHUNKLENGTH], const bool (&isvalid)[CHUNKLENGTH]) 395 errmsg << "rank "<<this->myRank<<": Error! Tried to reset() a synchronised buffer! This is forbidden unless force=true. (buffer name = "<<this->get_label()<<")"; 406 if(this->myRank==0 or not this->MPI_mode()) // Can only touch datasets on master process (unless we are in non-MPI mode) 421 void VertexBufferNumeric1D_HDF5<T,CHUNKLENGTH>::attempt_postponed_RA_write_to_disk(const std::map<PPIDpair, ulong>& PPID_to_dsetindex) 468 errmsg << "rank "<<this->myRank<<": Error! now_i has exceeded CHUNKLENGTH (now_i=="<<now_i<<") during attempt to perform postponed RA_writes. (buffer name = "<<this->get_label()<<")"; 492 void VertexBufferNumeric1D_HDF5<T,CHUNKLENGTH>::RA_write_to_disk(const std::map<PPIDpair, ulong>& PPID_to_dsetindex) 497 errmsg << "rank "<<this->myRank<<": Error! Non-synchronised buffer attempted to perform RA_write_to_disk! Only non-synchronised buffers are permitted to do this. (buffer name = "<<this->get_label()<<")"; 507 std::cout<<"rank "<<this->myRank<<": Extended RA dset '"<<this->get_label()<<"' to at least size "<<target_sync_pos<<std::endl; 513 std::cout<<"rank "<<this->myRank<<": Doing RA_write_to_disk for buffer '"<<this->get_label()<<"' (note: target_sync_pos="<<target_sync_pos<<", dset_head_pos()="<<this->dset_head_pos()<<")"<<std::endl; 519 //std::cout<<"rank "<<this->myRank<<": Number of items remaining in postpone queue after write attempt = "<<postpone_write_queue_and_locs.size()<<"); buffer is '"<<this->get_label()<<"'"<<std::endl; 561 errmsg << "rank "<<this->myRank<<": Error! now_i has exceeded CHUNKLENGTH (now_i=="<<now_i<<"). (buffer name = "<<this->get_label()<<")"; 567 std::cout<<"rank "<<this->myRank<<": writing buffer for "<<this->get_label()<<" to disk; now_i="<<now_i<<std::endl; 597 std::cout<<"rank "<<this->myRank<<": Updated target_sync_pos to '"<<target_sync_pos<<" in buffer "<<this->get_label()<<std::endl; 606 std::cout<<"rank "<<this->myRank<<": Synchronising buffer '"<<this->get_label()<<"' to position "<<sync_pos<<" (current dset_head_pos() = "<<this->dset_head_pos()<<")"<<std::endl; 626 errmsg << "rank "<<this->myRank<<": Error! Attempted to move HDF5 write position backwards in buffer with label '"<<this->get_label()<<"'! (movediff ("<<movediff<<") = sync_pos ("<<sync_pos<<")+1 - dset_head_pos() ("<<this->dset_head_pos()<<")) This is a bug in the VertexBufferNumeric1D_HDF5 class or in a class which uses it (probably HDF5Printer). Please report it. (Note, writing to old points can be done but requires using special write functions)."; 634 errmsg << "rank "<<this->myRank<<": Error! Attempted to move HDF5 write position by 0 slots in buffer with label '"<<this->get_label()<<"' (movediff ("<<movediff<<") = sync_pos ("<<sync_pos<<")+1 - dset_head_pos ("<<this->dset_head_pos()<<")); this part is fine, however the buffer indicates that this position has already received a write (donepoint()==true) so it should have moved forward! This is a bug in the VertexBufferNumeric1D_HDF5 class or in a class which uses it (probably HDF5Printer). Please report it."; 642 errmsg << "rank "<<this->myRank<<": Error! Attempted to move HDF5 write position by >1 slots ("<<movediff<<") in buffer with label '"<<this->get_label()<<"' (movediff ("<<movediff<<") = sync_pos ("<<sync_pos<<")+1 - dset_head_pos() ("<<this->dset_head_pos()<<")). Buffer synchronisation should only happen one slot at a time. This is a bug in the VertexBufferNumeric1D_HDF5 class or in a class which uses it (probably HDF5Printer). Please report it."; 652 std::cout<<"rank "<<this->myRank<<": Moved "<<movediff<<" slot(s). # unwritten slots left in buffer = "<<slots_left<<". buffer_is_full = "<<this->sync_buffer_is_full()<<std::endl; 671 errmsg << "rank "<<this->myRank<<": Error! Lengths of 'data' and 'valid' datasets for buffer "<<this->get_label()<<" are different ("<<dsetdata().dset_length()<<" and "<<dsetvalid().dset_length()<<" respectively). This should never happen."; void reset_nextemptyslab() Definition: DataSetInterfaceBase.hpp:115 void extend_dset(const unsigned long i) Extend dataset to nearest multiple of CHUNKLENGTH above supplied length. Definition: DataSetInterfaceBase.hpp:382 bool is_synchronised() const Definition: VertexBufferBase.hpp:116 unsigned long get_nextemptyslab() const Definition: DataSetInterfaceBase.hpp:110 bool resume flag to indicate that GAMBIT is attempting to resume a run, so we need to hook into existing output s... Definition: VertexBufferBase.hpp:55 T buffer_entries[LENGTH] Definition: VertexBufferNumeric1D.hpp:99 bool buffer_valid[LENGTH] Buffer variables for sequential writing. Definition: VertexBufferNumeric1D.hpp:98 std::vector< std::pair< T, PPIDpair > > postpone_write_queue_and_locs Extendible backup buffers for RA writes that need to be postponed due to the original sync writes not... Definition: VertexBufferNumeric1D_HDF5.hpp:63 virtual void RA_write_to_disk(const std::map< PPIDpair, ulong > &PPID_to_dsetindex) Send random access write queue to dataset interfaces for writing. Definition: VertexBufferNumeric1D_HDF5.hpp:492 bool sync_buffer_is_full() const Definition: VertexBufferBase.hpp:114 DataSetInterfaceScalar< bool, CHUNKLENGTH > & dsetvalid() Getters for HDF5 dataset interfaces (extra error checking) Definition: VertexBufferNumeric1D_HDF5.hpp:324 unsigned int get_head_position() const Definition: VertexBufferBase.hpp:120 Logging access header for GAMBIT. unsigned long target_sync_pos Variable obtained from somewhere external to the buffer, used to track the synchronisation position w... Definition: VertexBufferNumeric1D_HDF5.hpp:72 DataSetInterfaceScalar< bool, CHUNKLENGTH > _dsetvalid Interfaces to HDF5 datasets. Definition: VertexBufferNumeric1D_HDF5.hpp:53 Declaration of VertexBufferNumeric1D class This version of VertexBufferBase adds a series of routines... unsigned long nextemptyslab Dimension-0 index of the next empty hyperslab in the output datasets. Definition: VertexBufferNumeric1D_HDF5.hpp:66 virtual void finalise() Definition: VertexBufferNumeric1D_HDF5.hpp:679 VertexBuffer for simple numerical types. Definition: VertexBufferNumeric1D.hpp:93 virtual void write_to_disk() Write sync buffer to HDF5 dataset. Definition: VertexBufferNumeric1D_HDF5.hpp:354 virtual unsigned long dset_head_pos() (virtual for debugging purposes) Current absolute "write head" position for synchronised buffers ... Definition: VertexBufferNumeric1D_HDF5.hpp:109 virtual void update_dset_head_pos() Update the variables needed to tracks the currently target dset slot (really just updates the nextemp... Definition: VertexBufferNumeric1D_HDF5.hpp:134 bool MPI_mode() const Definition: VertexBufferBase.hpp:119 virtual void write_external_to_disk(const T(&values)[CHUNKLENGTH], const bool(&isvalid)[CHUNKLENGTH]) Write externally-supplied buffer to HDF5 dataset. Definition: VertexBufferNumeric1D_HDF5.hpp:378 void synchronise_output_to_position(const ulong i) Ensure dataset "write head" (i.e. Definition: VertexBufferNumeric1D_HDF5.hpp:585 void attempt_postponed_RA_write_to_disk(const std::map< PPIDpair, ulong > &PPID_to_dsetindex) Attempt to write any postponed RA_write attempts to disk. Definition: VertexBufferNumeric1D_HDF5.hpp:421 virtual void reset(bool force=false) Reset the output (non-synchronised datasets only, unless force=true) Definition: VertexBufferNumeric1D_HDF5.hpp:390 PPIDpair RA_write_locations[LENGTH] Target pointIDs for RA writes. Definition: VertexBufferNumeric1D.hpp:125 const Logging::endofmessage EOM Explicit const instance of the end of message struct in Gambit namespace. Definition: logger.hpp:99 Struct for a collection of MPI tags belonging to a single buffer. Definition: VertexBufferNumeric1D.hpp:49 Logging::LogMaster & logger() Function to retrieve a reference to the Gambit global log object. Definition: logger.cpp:95 VertexBuffer for simple numerical types - derived version that handles output to hdf5. Definition: VertexBufferNumeric1D_HDF5.hpp:49 unsigned long dset_length() const Definition: DataSetInterfaceBase.hpp:111 Definition: log_tags.hpp:53 char access flag to indicate the buffer access mode (i.e. read/write) Definition: VertexBufferBase.hpp:63 DataSetInterfaceScalar< T, CHUNKLENGTH > & dsetdata() Definition: VertexBufferNumeric1D_HDF5.hpp:338 void RA_write(const T(&values)[CHUNKLENGTH], const hsize_t(&coords)[CHUNKLENGTH], std::size_t npoints) Perform desynchronised ("random access") dataset writes to previous scan iterations from a queue... Definition: DataSetInterfaceScalar.hpp:173 bool sync_buffer_is_empty() const Definition: VertexBufferBase.hpp:115 A simple C++ wrapper for the MPI C bindings. virtual void sync_report() Definition: VertexBufferNumeric1D_HDF5.hpp:307 void writenewchunk(const T(&chunkdata)[CHUNKLENGTH]) Write data to a new chunk in the hosted dataset. Definition: DataSetInterfaceScalar.hpp:101 Declaration for class DataSetInterfaceScalar. Exception objects required for standalone compilation. ulong get_dataset_length() Definition: VertexBufferNumeric1D_HDF5.hpp:666 T RA_write_queue[LENGTH] Definition: VertexBufferNumeric1D.hpp:123 std::size_t postponed_RA_queue_length() Check how many RA writes are waiting in the postpone queue (mostly for debugging purposes) ... Definition: VertexBufferNumeric1D_HDF5.hpp:156 bool sync_buffer_full flag to indicate if the sync buffer is full (and ready for sending/dumping) Definition: VertexBufferBase.hpp:67 bool is_silenced() const Definition: VertexBufferBase.hpp:117 ~VertexBufferNumeric1D_HDF5() Destructor Make sure buffer contents are written to file when buffer object is destroyed. Definition: VertexBufferNumeric1D_HDF5.hpp:295 virtual void skip_append() No data to append this iteration; skip this slot. Definition: VertexBufferNumeric1D.hpp:373 pointID / process number pair Used to identify a single parameter space point Definition: new_mpi_datatypes.hpp:90 DataSetInterfaceScalar< T, CHUNKLENGTH > _dsetdata Definition: VertexBufferNumeric1D_HDF5.hpp:54 std::string get_label() const Definition: VertexBufferBase.hpp:110 |