Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Assertion.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* Assertion.cc (C) 2000-2020 */
9/* */
10/* Set of assertions used for unit tests. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
15
16#include "arcane/core/IParallelMng.h"
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21namespace Arcane
22{
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27void Assertion::
28_checkAssertion(bool is_error, const TraceInfo& where,
29 const String& expected, const String& actual, IParallelMng* pm)
30{
31 bool global_error = is_error;
32 if (pm) {
33 Int32 e = (is_error) ? 1 : 0;
34 Int32 ge = pm->reduce(Parallel::ReduceSum, e);
35 global_error = (ge != 0);
36 }
37 if (global_error)
38 throw AssertionException(where, expected, actual);
39}
40
41/*---------------------------------------------------------------------------*/
42/*---------------------------------------------------------------------------*/
43
44} // End namespace Arcane
45
46/*---------------------------------------------------------------------------*/
47/*---------------------------------------------------------------------------*/
Interface of the parallelism manager for a subdomain.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int32_t Int32
Signed integer type of 32 bits.