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
14
#include "
arcane/core/Assertion.h
"
15
16
#include "arcane/core/IParallelMng.h"
17
18
/*---------------------------------------------------------------------------*/
19
/*---------------------------------------------------------------------------*/
20
21
namespace
Arcane
22
{
23
24
/*---------------------------------------------------------------------------*/
25
/*---------------------------------------------------------------------------*/
26
27
void
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
/*---------------------------------------------------------------------------*/
Assertion.h
Arcane::IParallelMng
Interface of the parallelism manager for a subdomain.
Definition
IParallelMng.h:53
Arcane::String
Unicode character string.
Definition
arccore/src/base/arccore/base/String.h:70
Arcane::TraceInfo
Trace information.
Definition
arccore/src/base/arccore/base/TraceInfo.h:34
Arcane::MessagePassing::ReduceSum
@ ReduceSum
Sum of values.
Definition
MessagePassingGlobal.h:114
Arcane
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition
arcane/src/arcane/accelerator/AcceleratorGlobal.h:37
Arcane::Int32
std::int32_t Int32
Signed integer type of 32 bits.
Definition
ArccoreGlobal.h:233
arcane
core
Assertion.cc
Generated on
for Arcane by
1.16.1