• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Open-Sn / opensn / 27922676724

21 Jun 2026 09:16PM UTC coverage: 78.584% (+1.1%) from 77.467%
27922676724

push

github

web-flow
Merge pull request #1108 from wdhawkins/disable_hip_tests

Temporarily disable HIP tests

26280 of 33442 relevant lines covered (78.58%)

86617107.22 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/framework/runtime.cc
1
// SPDX-FileCopyrightText: 2024 The OpenSn Authors <https://open-sn.github.io/opensn/>
2
// SPDX-License-Identifier: MIT
3

4
#include "framework/runtime.h"
5
#include "framework/math/math.h"
6
#include "framework/object_factory.h"
7
#include "framework/utils/timer.h"
8
#include "config.h"
9
#include "caliper/cali.h"
10
#include "hdf5.h"
11
#include <cstdlib>
12
#include <iostream>
13

14
namespace opensn
15
{
16
namespace
17
{
18

19
unsigned int
20
ResolveOpenSnNumThreads()
1,014✔
21
{
22
  // OpenSn reads this once during runtime initialization before any internal
23
  // worker threads are created.
24
  const char* env_value = std::getenv("OPENSN_NUM_THREADS"); // NOLINT(concurrency-mt-unsafe)
1,014✔
25
  if (env_value == nullptr)
1,014✔
26
    return 1;
27

28
  try
2✔
29
  {
30
    const auto parsed_value = std::stoul(env_value);
4✔
31
    return parsed_value > 0 ? static_cast<unsigned int>(parsed_value) : 1U;
2✔
32
  }
33
  catch (const std::exception&)
×
34
  {
35
    return 1;
×
36
  }
×
37
}
38

39
} // namespace
40

41
// Global variables
42
mpi::Communicator mpi_comm;
43
bool use_caliper = false;
44
std::string cali_config("runtime-report(calc.inclusive=true),max_column_width=80");
45
cali::ConfigManager cali_mgr;
46
Timer program_timer;
47
std::filesystem::path input_path;
48
unsigned int opensn_num_threads = 1;
49

50
int
51
Initialize()
1,014✔
52
{
53
  opensn_num_threads = ResolveOpenSnNumThreads();
1,014✔
54

55
  if (use_caliper)
1,014✔
56
  {
57
    cali_mgr.add(cali_config.c_str());
×
58
    cali_set_global_string_byname("opensn.version", GetVersionStr().c_str());
×
59
    cali_set_global_string_byname("opensn.input", input_path.c_str());
×
60
    cali_mgr.start();
×
61
  }
62

63
  CALI_MARK_PHASE_BEGIN(opensn::program.c_str());
1,014✔
64

65
  // Disable internal HDF error reporting
66
  H5Eset_auto2(H5E_DEFAULT, nullptr, nullptr);
1,014✔
67

68
  return 0;
1,014✔
69
}
70

71
void
72
Finalize()
1,012✔
73
{
74
  // Flush standard streams
75
  std::cout.flush();
1,012✔
76
  std::cerr.flush();
1,012✔
77
  std::clog.flush();
1,012✔
78

79
  opensn::mpi_comm.barrier();
1,012✔
80

81
  CALI_MARK_PHASE_END(opensn::program.c_str());
1,012✔
82
}
1,012✔
83

84
std::string
85
GetVersionStr()
310✔
86
{
87
  return PROJECT_VERSION;
310✔
88
}
89

90
} // namespace opensn
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc