omega_h
Reliable mesh adaptation
Omega_h_library.hpp
1 #ifndef OMEGA_H_LIBRARY_HPP
2 #define OMEGA_H_LIBRARY_HPP
3 
4 #include <map>
5 
6 #include <Omega_h_comm.hpp>
7 
8 namespace Omega_h {
9 
10 class Library {
11  public:
12  Library(Library const&);
13  inline Library() : Library(nullptr, nullptr) {}
14  inline Library(int* argc, char*** argv
15 #ifdef OMEGA_H_USE_MPI
16  ,
17  MPI_Comm comm_mpi = MPI_COMM_WORLD
18 #endif
19  ) {
20  initialize(OMEGA_H_SEMVER, argc, argv
21 #ifdef OMEGA_H_USE_MPI
22  ,
23  comm_mpi
24 #endif
25  );
26  }
27  ~Library();
28  static char const* static_version();
29  char const* version();
30  static char const* static_commit_id();
31  char const* commit_id();
32  static char const* static_configure_options();
33  char const* configure_options();
34  CommPtr world();
35  CommPtr self();
36  void add_to_timer(std::string const& name, double nsecs);
37  LO self_send_threshold() const;
38  LO self_send_threshold_;
39  bool silent_;
40  std::vector<std::string> argv_;
41 
42  private:
43  void initialize(char const* head_desc, int* argc, char*** argv
44 #ifdef OMEGA_H_USE_MPI
45  ,
46  MPI_Comm comm_mpi
47 #endif
48  );
49  CommPtr world_;
50  CommPtr self_;
51 #ifdef OMEGA_H_USE_MPI
52  bool we_called_mpi_init;
53 #endif
54 #ifdef OMEGA_H_USE_KOKKOS
55  bool we_called_kokkos_init;
56 #endif
57  std::map<std::string, double> timers;
58 };
59 
60 extern char* max_memory_stacktrace;
61 
62 } // namespace Omega_h
63 
64 #endif
Definition: Omega_h_library.hpp:10
Definition: amr_mpi_test.cpp:6