Skip to content
Snippets Groups Projects
Commit 10d09b78 authored by Michael Buehlmann's avatar Michael Buehlmann
Browse files

Merge branch 'master' into 'master'

flushAll() returns result and can be called multiple times

See merge request hacc/genericio!14
parents 2148811a b41f5c6d
No related branches found
No related tags found
No related merge requests found
...@@ -461,7 +461,13 @@ public: ...@@ -461,7 +461,13 @@ public:
static void setNaturalDefaultPartition(); static void setNaturalDefaultPartition();
static void flushAll() { static bool flushAll() {
#ifdef GENERICIO_WITH_VELOC
return GenericFileIO_VELOC::flush();
#endif
}
static void shutdown() {
#ifdef GENERICIO_WITH_VELOC #ifdef GENERICIO_WITH_VELOC
GenericFileIO_VELOC::flush(); GenericFileIO_VELOC::flush();
#endif #endif
......
...@@ -115,10 +115,11 @@ Instructions can be found here: [https://veloc.readthedocs.io](https://veloc.rea ...@@ -115,10 +115,11 @@ Instructions can be found here: [https://veloc.readthedocs.io](https://veloc.rea
**Install** **Install**
Set the VELOC_INSTALL_DIR variable in GNUMakefile to the root of the VELOC installation directory. Set the VELOC_INSTALL_DIR variable in GNUMakefile to the root of the VELOC installation directory.
Then proceed to compile and link GIO as usual. Then proceed to compile and link GIO as usual.
**Run** **Run**
Define the GENERICIO_USE_VELOC environment variable as the path to the VELOC configuration file. Define the GENERICIO_USE_VELOC environment variable as the path to the scratch directory.
An example is available here: veloc.cfg The scratch directory will be used as a local cache and needs to be a NVMe mount point on the compute node.
Define the VELOC_MAX_CACHE_SIZE environment variable as the maximum size (in bytes) of unflushed data allowed in the scratch folder.
...@@ -40,8 +40,11 @@ void GenericFileIO_VELOC::write(const void *buf, size_t count, off_t offset, con ...@@ -40,8 +40,11 @@ void GenericFileIO_VELOC::write(const void *buf, size_t count, off_t offset, con
throw std::runtime_error("Unable to write " + D + " to file: " + FileName + ": " + strerror(errno)); throw std::runtime_error("Unable to write " + D + " to file: " + FileName + ": " + strerror(errno));
} }
void GenericFileIO_VELOC::flush() { bool GenericFileIO_VELOC::flush() {
veloc::cached_file_t::flush(); return veloc::cached_file_t::flush();
}
void GenericFileIO_VELOC::shutdown() {
veloc::cached_file_t::shutdown(); veloc::cached_file_t::shutdown();
} }
......
...@@ -15,7 +15,8 @@ public: ...@@ -15,7 +15,8 @@ public:
void setSize(size_t sz); void setSize(size_t sz);
void read(void *buf, size_t count, off_t offset, const std::string &D); void read(void *buf, size_t count, off_t offset, const std::string &D);
void write(const void *buf, size_t count, off_t offset, const std::string &D); void write(const void *buf, size_t count, off_t offset, const std::string &D);
static void flush(); static bool flush();
static void shutdown();
protected: protected:
int FH; int FH;
......
scratch = /tmp/scratch
persistent = /tmp/persistent
mode = async
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment