environment(2rheolef)
π environment(2rheolef) π
ok so bestie, we're in the rheolef manual β that's the rheolef-7.2 era, section 2, and today's main character is literally just called environment. yes, the whole class. she's the setup girlie who gets everything ready before the real work starts. let's get into it π
β¨ NAME β¨
environment β initialization of distributed computations (rheolef-7.2)
πΈ DESCRIPTION πΈ
So this class? Her whole job is initializing the MPI library. That's it, that's the assignment. And you gotta call her juste after the main(argc,argv) declaration β like, right after, no dawdling, no "let me do one thing first", because nothing else works until she's done her thing. periodt.
#include 'rheolef.h'
using namespace rheolef;
int main (int argc, char**argv) {
environment rheolef (argc, argv);
...
}
Now, there's an optional third argument on the environment constructor that lets you set the MPI thread feature. By default its value is MPI_THREAD_MULTIPLE, as defined in mpi.h. The other possible values are all about MPI multi-threaded stuff β so go read the MPI documentation for more details, iykyk π
And here's the cute part: when you compile in a non-distributed configuration of the Rheolef library, this is a do-nothing class. she literally just stands there and vibes. iconic honestly π
π¦ NOTE π¦
The interface of this class is inspirated from the boost::mpi::environment class. But β and this is the glow-up β instead of the boost implementation that calls MPI_Init(), here this class calls MPI_Init_thread() instead. Why do we care? Because this extension allows one to support the scotch library when it's been compiled with the threads feature. she said "I can do both" and she did π₯
π IMPLEMENTATION π
This documentation has been generated from file linalg/lib/environment.h β bestie, go look at the source if you want the real tea π
class environment {
public:
environment (int& argc, char**& argv, const environment_option_type& opt = environment_option_type());
~environment();
};
struct environment_option_type {
static const int no_thread = 100;
static const int default_thread = MPI_THREAD_MULTIPLE;
environment_option_type() : thread_level (default_thread) {}
int thread_level ;
};
look at that struct. no_thread = 100, default_thread = MPI_THREAD_MULTIPLE, and thread_level defaulting to default_thread in the constructor. clean. no notes. π«Ά
π 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.
bestie that NO WARRANTY is in all caps for a reason, don't come for her later π
ok that's the whole page, mwah π this was environment(2rheolef) from the rheolef manual, Version 7.2 β go forth and initialize responsibly, she's rooting for you π§π
π¦ 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