Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
initialize_finalize.hpp
Go to the documentation of this file.
1//This file is part of Bertini 2.
2//
3//bertini2/parallel/initialize_finalize.hpp is free software: you can redistribute it and/or modify
4//it under the terms of the GNU General Public License as published by
5//the Free Software Foundation, either version 3 of the License, or
6//(at your option) any later version.
7//
8//bertini2/parallel/initialize_finalize.hpp is distributed in the hope that it will be useful,
9//but WITHOUT ANY WARRANTY; without even the implied warranty of
10//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11//GNU General Public License for more details.
12//
13//You should have received a copy of the GNU General Public License
14//along with bertini2/parallel/initialize_finalize.hpp. If not, see <http://www.gnu.org/licenses/>.
15//
16// Copyright(C) Bertini2 Development Team
17//
18// See <http://www.gnu.org/licenses/> for a copy of the license,
19// as well as COPYING. Bertini2 is provided with permitted
20// additional terms in the b2/licenses/ directory.
21
22
28
29
30#pragma once
31
32#include <iostream>
33
34#include "bertini2/logging.hpp"
36
37#ifdef BERTINI2_HAVE_MPI
39#endif
40
41namespace bertini{
42
43 namespace parallel{
44
46 void Finalize();
48 void Initialize();
49
50#ifdef BERTINI2_HAVE_MPI
51 MPI_Comm WorldComm();
52#endif
53
54 // These work in both serial and parallel builds.
55 // In serial builds (no MPI) they return constants matching a single-rank world.
57 int Rank();
59 int Size();
61 bool IsManager(); // true iff Rank() == 0
63 bool IsWorker(); // true iff Rank() != 0
64
65 }
66
67 namespace serial{
69 void Finalize();
71 void Initialize();
72 }
73}
Logging in Bertini using Boost.Log.
Single include point for the MPI C API.
Definition initialize_finalize.hpp:43
int Size()
Get the number of ranks (1 in serial builds).
void Finalize()
Finalize the parallel (MPI) environment.
bool IsManager()
Query whether this rank is the manager (rank 0).
void Initialize()
Initialize the parallel (MPI) environment.
bool IsWorker()
Query whether this rank is a worker (rank != 0).
int Rank()
Get this process's rank (0 in serial builds).
Definition initialize_finalize.hpp:67
void Finalize()
Finalize the serial environment (no-op counterpart to the parallel version).
void Initialize()
Initialize the serial environment (no-op counterpart to the parallel version).
Definition algorithm_builder.hpp:36
Provides the splash screens for bertini2.