Interface Documentation
Version: invalid
context.hh
Go to the documentation of this file.
1 /*
2  @@@@@@@@ @@ @@@@@@ @@@@@@@@ @@
3  /@@///// /@@ @@////@@ @@////// /@@
4  /@@ /@@ @@@@@ @@ // /@@ /@@
5  /@@@@@@@ /@@ @@///@@/@@ /@@@@@@@@@/@@
6  /@@//// /@@/@@@@@@@/@@ ////////@@/@@
7  /@@ /@@/@@//// //@@ @@ /@@/@@
8  /@@ @@@//@@@@@@ //@@@@@@ @@@@@@@@ /@@
9  // /// ////// ////// //////// //
10 
11  Copyright (c) 2016, Triad National Security, LLC
12  All rights reserved.
13  */
14 #pragma once
15 
18 #include <flecsi-config.h>
19 
20 #if !defined(__FLECSI_PRIVATE__)
21 #error Do not include this file directly!
22 #endif
23 
24 #if !defined(FLECSI_ENABLE_MPI)
25 #error FLECSI_ENABLE_MPI not defined! This file depends on MPI!
26 #endif
27 
28 #include "../context.hh"
29 
30 #include <boost/program_options.hpp>
31 #include <mpi.h>
32 
33 #include <map>
34 
35 namespace flecsi::run {
36 
37 struct context_t : context {
38 
39  //--------------------------------------------------------------------------//
40  // Runtime.
41  //--------------------------------------------------------------------------//
42 
47  int initialize(int argc, char ** argv, bool dependent);
48 
53  void finalize();
54 
59  int start(const std::function<int()> &);
60 
65  size_t process() const {
66  return process_;
67  }
68 
69  size_t processes() const {
70  return processes_;
71  }
72 
73  size_t threads_per_process() const {
74  return 1;
75  }
76 
77  size_t threads() const {
78  return 0;
79  }
80 
81  /*
82  Documnetation for this interface is in the top-level context type.
83  */
84 
85  static size_t task_depth() {
86  return 0;
87  } // task_depth
88 
89  /*
90  Documnetation for this interface is in the top-level context type.
91  */
92 
93  size_t color() const {
94  return process_;
95  }
96 
97  /*
98  Documnetation for this interface is in the top-level context type.
99  */
100 
101  size_t colors() const {
102  return processes_;
103  }
104 };
105 
106 } // namespace flecsi::run
size_t process() const
Definition: context.hh:65
Definition: backend.hh:41