#include <distributed_db.hpp>
|
typedef boost::interprocess::basic_managed_mapped_file< char,boost::interprocess::rbtree_best_fit< boost::interprocess::null_mutex_family >,boost::interprocess::iset_index > | mapped_type |
|
Definition at line 86 of file distributed_db.hpp.
typedef boost::interprocess::basic_managed_mapped_file<char ,boost::interprocess::rbtree_best_fit<boost::interprocess::null_mutex_family> ,boost::interprocess::iset_index> havoqgt::distributed_db::mapped_type |
|
private |
havoqgt::distributed_db::distributed_db |
( |
db_create |
, |
|
|
const char * |
base_fname |
|
) |
| |
|
inline |
Definition at line 106 of file distributed_db.hpp.
119 #ifdef HAVE_POSIX_FALLOCATE
133 #warning posix_fallocate not found; OSX?
138 header* phead =
m_pm->construct<header>(boost::interprocess::unique_instance)();
140 phead->uuid = boost::uuids::random_generator()();
144 phead->comm_rank = mpi_rank;
145 phead->comm_size = mpi_size;
146 phead->clean_close =
false;
std::string m_rank_filename
const communicator & world_comm() const
environment * havoqgt_env()
boost::interprocess::basic_managed_mapped_file< char,boost::interprocess::rbtree_best_fit< boost::interprocess::null_mutex_family >,boost::interprocess::iset_index > mapped_type
void init_rank_filename(const char *base_fname)
void mpi_bcast(T &data, int root, MPI_Comm comm)
#define HAVOQGT_ERROR_MSG(msg)
havoqgt::distributed_db::distributed_db |
( |
db_open |
, |
|
|
const char * |
base_fname |
|
) |
| |
|
inline |
Definition at line 152 of file distributed_db.hpp.
160 std::stringstream error;
161 error <<
"ERROR: " << __FILE__ <<
":" << __LINE__ <<
": file not found.";
162 throw std::runtime_error(error.str());
169 std::pair<header*, std::size_t> ret =
m_pm->find<header>(boost::interprocess::unique_instance);
170 if(ret.second == 0) {
171 std::stringstream error;
172 error <<
"ERROR: " << __FILE__ <<
":" << __LINE__ <<
": header now found.";
173 throw std::runtime_error(error.str());
178 boost::uuids::uuid uuid;
180 uuid = ret.first->uuid;
183 if(uuid != ret.first->uuid)
185 std::stringstream error;
186 error <<
"ERROR: " << __FILE__ <<
":" << __LINE__ <<
": UUIDs don't match.";
187 throw std::runtime_error(error.str());
190 if(ret.first->comm_rank != mpi_rank ||
191 ret.first->comm_size != mpi_size ||
192 !ret.first->clean_close) {
193 std::stringstream error;
194 error <<
"ERROR: " << __FILE__ <<
":" << __LINE__ <<
": DB corrupt.";
195 throw std::runtime_error(error.str());
std::string m_rank_filename
const communicator & world_comm() const
environment * havoqgt_env()
boost::interprocess::basic_managed_mapped_file< char,boost::interprocess::rbtree_best_fit< boost::interprocess::null_mutex_family >,boost::interprocess::iset_index > mapped_type
void init_rank_filename(const char *base_fname)
void mpi_bcast(T &data, int root, MPI_Comm comm)
havoqgt::distributed_db::~distributed_db |
( |
| ) |
|
|
inline |
Definition at line 202 of file distributed_db.hpp.
206 std::pair<header*, std::size_t> ret =
m_pm->find<header>(boost::interprocess::unique_instance);
207 if(ret.second == 0) {
208 std::stringstream error;
209 error <<
"ERROR: " << __FILE__ <<
":" << __LINE__ <<
": header now found.";
210 throw std::runtime_error(error.str());
212 ret.first->clean_close =
true;
std::string m_rank_filename
uint64_t havoqgt::distributed_db::get_file_size |
( |
| ) |
|
|
inlineprivate |
Definition at line 229 of file distributed_db.hpp.
231 const char* fsize = getenv(
"HAVOQGT_DB_SIZE");
240 return boost::lexical_cast<uint64_t>(fsize);
environment * havoqgt_env()
const communicator & node_local_comm() const
void havoqgt::distributed_db::init_rank_filename |
( |
const char * |
base_fname | ) |
|
|
inlineprivate |
Definition at line 256 of file distributed_db.hpp.
260 std::stringstream sstr;
261 sstr << base_fname <<
"_" << mpi_rank <<
"_of_" << mpi_size;
std::string m_rank_filename
const communicator & world_comm() const
environment * havoqgt_env()
bool havoqgt::distributed_db::rank_file_exists |
( |
| ) |
|
|
inlineprivate |
std::string havoqgt::distributed_db::m_rank_filename |
|
private |
The documentation for this class was generated from the following file: