Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::SequentialSection Class Reference

Section of code to be executed sequentially. More...

#include <arcane/core/SequentialSection.h>

Public Member Functions

 SequentialSection (IParallelMng *)
 SequentialSection (ISubDomain *)
void setError (bool is_error)

Detailed Description

Section of code to be executed sequentially.

An instance of this class allows a part of the code to run as if the code were sequential. The code within the lifetime of this object is first executed on proc 0, and then, if everything is okay on the others. This allows checking it once when the code executed is the same everywhere (for example, reading the dataset) and displaying messages only once in case of an error.

Since potential errors are only displayed by a single subdomain, this class should only be used when you are certain that all subdomains perform the same processing, otherwise errors will not be recognized.

Furthermore, since all subdomains block until the first subdomain has finished executing the code, you must not call the parallelism manager in this section.

In case of an error, an exception of type ExParallelFatalError is sent in the destructor.

{
SequentialSection ss(pm);
... // Code executed sequentially.
ss.setError(true);
}

Definition at line 58 of file SequentialSection.h.

Constructor & Destructor Documentation

◆ SequentialSection() [1/2]

Arcane::SequentialSection::SequentialSection ( IParallelMng * pm)
explicit

Definition at line 32 of file SequentialSection.cc.

◆ SequentialSection() [2/2]

Arcane::SequentialSection::SequentialSection ( ISubDomain * sd)
explicit

Definition at line 43 of file SequentialSection.cc.

◆ ~SequentialSection()

Arcane::SequentialSection::~SequentialSection ( )

Definition at line 54 of file SequentialSection.cc.

Member Function Documentation

◆ setError()

void Arcane::SequentialSection::setError ( bool is_error)

Definition at line 108 of file SequentialSection.cc.


The documentation for this class was generated from the following files: