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 <mutex>
17#include <optional>
18#include <vector>
19
20namespace madness{
21
23
24 class ParsecRuntime {
25 private:
26 static parsec_context_t *ctx;
27 static std::optional<bool> made_new_ctx;
28 static parsec_taskpool_t *tp;
29 static bool parsec_restart_taskpool;
30 /// Copies of ES[0] made for threads outside PaRSEC's pool, one per thread
31 static std::vector<parsec_execution_stream_t *> non_parsec_thread_es;
32 static std::mutex non_parsec_thread_es_mutex;
33#ifdef PARSEC_PROF_TRACE
34 static int taskpool_profiling_array[2];
35#endif /* PARSEC_PROF_TRACE */
36
37 public:
38 ParsecRuntime(int nb_threads);
39 ~ParsecRuntime();
40
41 static parsec_context_t* context();
42 static void initialize_with_existing_context(parsec_context_t* ctx);
43 static parsec_execution_stream_t *execution_stream();
44 static void schedule(PoolTaskInterface* task);
45 static int test();
46 static void wait();
47 static parsec_task_t *task(bool is_high_priority, void *ptr);
48 static void delete_parsec_task(parsec_task_t *t);
49 };
50}
51
52#endif // HAVE_PARSEC
53
54#endif // MADNESS_PARSEC_INCLUED
Lowest level task interface.
Definition thread.h:874
Macros and tools pertaining to the configuration of MADNESS.
Namespace for all elements and tools of MADNESS.
Definition DFConvergence.h:9
int task(int i)
Definition test_runtime.cpp:4
void test()
Definition y.cc:696