MADNESS  0.10.1
parsec.h
Go to the documentation of this file.
1 #ifndef MADNESS_PARSEC_INCLUED
2 #define MADNESS_PARSEC_INCLUED
3 
5 
6 #ifdef HAVE_PARSEC
7 
8 #include <parsec.h>
9 #include <parsec/parsec_config.h>
10 #include <parsec/parsec_internal.h>
11 #include <parsec/mca/device/device.h>
12 #include <parsec/execution_stream.h>
13 #include <parsec/scheduling.h>
14 
15 #include <iostream>
16 #include <optional>
17 
18 namespace madness{
19 
20  class PoolTaskInterface;
21 
22  class ParsecRuntime {
23  private:
24  static parsec_context_t *ctx;
25  static std::optional<bool> made_new_ctx;
26  static parsec_taskpool_t *tp;
27  static bool parsec_restart_taskpool;
28  static parsec_execution_stream_t *madness_comm_thread_es;
29 #ifdef PARSEC_PROF_TRACE
30  static int taskpool_profiling_array[2];
31 #endif /* PARSEC_PROF_TRACE */
32 
33  public:
34  ParsecRuntime(int nb_threads);
35  ~ParsecRuntime();
36 
37  static parsec_context_t* context();
38  static void initialize_with_existing_context(parsec_context_t* ctx);
39  static parsec_execution_stream_t *execution_stream();
40  static void schedule(PoolTaskInterface* task);
41  static int test();
42  static void wait();
43  static parsec_task_t *task(bool is_high_priority, void *ptr);
44  static void delete_parsec_task(parsec_task_t *t);
45  };
46 }
47 
48 #endif // HAVE_PARSEC
49 
50 #endif // MADNESS_PARSEC_INCLUED
void test(World &world, bool doloadbal=false)
Definition: dataloadbal.cc:224
Macros and tools pertaining to the configuration of MADNESS.
File holds all helper structures necessary for the CC_Operator and CC2 class.
Definition: DFParameters.h:10
int task(int i)
Definition: test_runtime.cpp:4