diststream(2rheolef)
β¨ diststream β¨
okay bestie, this is the rheolef-7.2 page for diststream, and it's literally the glow-up your i/o needed π
πΈ NAME πΈ
diststream β i/o streams in a distributed environment (rheolef-7.2) π¦
π DESCRIPTION π
so the idiststream and odiststream classes give you a stream input and output interface for parallel and distributed codes. The main difference? Let's talk about it, because it's giving main character energy β¨
Recall that, with the usual std::istream and std::ostream, any i/o operation is executed on all processes: e.g. the output is printed many times. Not cute. In contrast, idiststream and odiststream manage the distributed environment nicely π«Ά
For small data β like int, double or string β a specific processor is selected for i/o operations. For large data, the i/o operations are delegated to a specific class member function, when available. Periodt. π
And for convenience? The standard streams cin, cout, clog and cerr are extended as din, dout, dlog and derr, respectively. Obsessed with this fr fr π
π FILE SUFFIXES π
okay so, finally: an optional suffix extension to the file name is automatically handled π«
odiststream foo('NAME', 'suffix');
is similar to
ofstream foo('NAME.suffix');
Conversely,
irheostream foo('NAME','suffix');
is similar to
ifstream foo('NAME.suffix');
see how that works? iconic. π
π¦ FILE SEARCH π¦
Recursive search in a directory list is provided for finding the input file π However, we look at a search path environment variable RHEOPATH in order to find NAME while the suffix is assumed. And moreover? gzip compressed files, ending with the .gz suffix, are handled β and decompression is done automatically on the fly in that case. no cap. π§
π COMPRESSION π
File compression/decompresion is handled on the fly, thanks to the gzip library. The data compression is assumed by default for output: it can be deactivated while opening a file by an optional argument:
odiststream foo('NAME', 'suffix', io::nogz);
lowkey the vibes here are immaculate π
π APPEND MODE π
An existing file, possibly compressed, can be reopen in append mode. New results will be appended at the end of an existing file:
odiststream foo('NAME', 'suffix', io::app);
so you keep the old stuff and stack the new stuff on top, bestie β¨
π«Ά FLUSH π«Ά
The flush member function is nicely handled in compression mode: this feature allows intermediate results to be available during long computations. Buffers are flushed and data are available in the output file. literally perfect for those long-running jobs ππ₯
π IMPLEMENTATION π
This documentation has been generated from file linalg/lib/diststream.h π
class idiststream {
public:
typedef std::size_t size_type;
// allocators/deallocators:
idiststream();
idiststream (std::istream& is, const communicator& comm = communicator());
idiststream (std::string filename, std::string suffix = "",
const communicator& comm = communicator());
~idiststream();
// modifiers:
void open (std::string filename, std::string suffix = "",
const communicator& comm = communicator());
void close();
// accessors:
const communicator& comm() const { return _comm; }
bool good() const;
operator bool() const { return good(); }
static size_type io_proc();
};
class odiststream {
public:
typedef std::size_t size_type;
// allocators/deallocators:
odiststream();
odiststream (std::string filename, std::string suffix = "",
io::mode_type mode = io::out, const communicator& comm = communicator());
odiststream (std::string filename,
io::mode_type mode, const communicator& comm = communicator());
odiststream (std::string filename, std::string suffix, const communicator& comm);
odiststream (std::string filename, const communicator& comm);
odiststream(std::ostream& os, const communicator& comm = communicator());
~odiststream();
// modifiers:
void open (std::string filename, std::string suffix = "",
io::mode_type mode = io::out, const communicator& comm = communicator());
void open (std::string filename,
io::mode_type mode, const communicator& comm = communicator());
void open (std::string filename, std::string suffix,
const communicator& comm);
void open (std::string filename, const communicator& comm);
void flush();
void close();
// accessors:
const communicator& comm() const { return _comm; }
bool good() const;
operator bool() const { return good(); }
static size_type io_proc();
};
π AUTHOR π
Pierre Saramito <Pierre.Saramito@imag.fr> π
β COPYRIGHT β
Copyright (C) 2000-2018 Pierre Saramito <Pierre.Saramito@imag.fr> GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. π
aaaand that's the whole page bestie π this was rheolef Version 7.2, and the page is diststream(2rheolef). go forth and stream, you got this πβ¨π¦
π¦ where this page comes from
- debian trixie: librheolef-dev 7.2-4 Β· GPL-3.0-or-later
- ubuntu noble: librheolef-dev 7.2-3build5 Β· GPL-3.0-or-later
- ubuntu questing: librheolef-dev 7.2-4build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms