The Quantum Exact Simulation Toolkit v4.2.0
Loading...
Searching...
No Matches
environment.h
1/** @file
2 * API signatures for managing the QuEST
3 * execution environment.
4 *
5 * @author Tyson Jones
6 * @author Richard Meister (aided in design)
7 *
8 * @defgroup environment Environment
9 * @ingroup api
10 * @brief Data structures for managing the QuEST execution environment.
11 * @{
12 */
13
14#ifndef ENVIRONMENT_H
15#define ENVIRONMENT_H
16
17// enable invocation by both C and C++ binaries
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22
23
24/*
25 * QuESTEnv is a struct of which there will be a single, immutable
26 * main instance, statically instantiated inside environment.cpp,
27 * accessible anywhere via a getter, and which is consulted for
28 * determining the deployment configuration. Users can obtain a
29 * local copy of this struct with getQuESTEnv().
30 */
31
32/// @notyetdoced
33typedef struct {
34
35 // deployment modes which can be runtime disabled
36 int isMultithreaded;
37 int isGpuAccelerated;
38 int isDistributed;
39
40 // deployment modes which cannot be directly changed after compilation
41 int isCuQuantumEnabled;
42
43 // deployment configurations which can be changed via environment variables
44 int isGpuSharingEnabled;
45
46 // distributed configuration
47 int rank;
48 int numNodes;
49
50} QuESTEnv;
51
52
53/// @notyetdoced
54void initQuESTEnv();
55
56/** @notyetdoced
57 *
58 * @see
59 * - [C](https://github.com/QuEST-Kit/QuEST/blob/devel/examples/isolated/reporting_environments.c) and
60 * [C++](https://github.com/QuEST-Kit/QuEST/blob/devel/examples/isolated/reporting_environments.cpp) examples
61 */
62void initCustomQuESTEnv(int useDistrib, int useGpuAccel, int useMultithread);
63
64/// @notyetdoced
65void finalizeQuESTEnv();
66
67/// @notyetdoced
68void syncQuESTEnv();
69
70/** @notyetdoced
71 * @notyettested
72 *
73 * @see
74 * - [C](https://github.com/QuEST-Kit/QuEST/blob/devel/examples/isolated/reporting_environments.c) and
75 * [C++](https://github.com/QuEST-Kit/QuEST/blob/devel/examples/isolated/reporting_environments.cpp) examples
76 */
77void reportQuESTEnv();
78
79/// @notyetdoced
80int isQuESTEnvInit();
81
82/// @notyetdoced
84
85
86
87// end de-mangler
88#ifdef __cplusplus
89}
90#endif
91
92#endif // ENVIRONMENT_H
93
94/** @} */ // (end file-wide doxygen defgroup)
void reportQuESTEnv()
void finalizeQuESTEnv()
void initCustomQuESTEnv(int useDistrib, int useGpuAccel, int useMultithread)
QuESTEnv getQuESTEnv()
int isQuESTEnvInit()
void syncQuESTEnv()
void initQuESTEnv()