environment(2rheolef)

πŸ“¦
version 7.2 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu questing

πŸ’– 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 (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