OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Globals.h
Go to the documentation of this file.
1#ifndef PYOPAL_GLOBALS_H
2#define PYOPAL_GLOBALS_H
3#include "opal.h"
4
5namespace {
6// I get a gcc warning "declared ‘static’ but never defined" if I uncomment this
7// but it is not declared static! confused %)
8/*
9 void errorHandlerGSL(const char *reason,
10 const char *file,
11 int line,
12 int gsl_errno);
13*/
14}
15
16// Ippl and gmsg should only be built once, in globals.cc.o
17//
18// We declare them as extern for all other code to be consistent with usage in
19// C++ Opal; but we define them if we are including from Globals.cc so that the
20// extern is satisfied.
21//
22// Maybe this implements one gmsg per python module - which is wrong? So maybe
23// some more linker/cmake dark arts required here? Do they have much global
24// state?
25
26#ifndef PYOPAL_GLOBALS_C
27 extern Ippl *ippl;
28 extern Inform *gmsg;
29#endif
30
31#ifdef PYOPAL_GLOBALS_C
32 Ippl *ippl = NULL;
33 Inform *gmsg = NULL;
34#endif
35namespace PyOpal {
36namespace Globals {
37
38void Initialise();
39}
40}
41
42#endif
void Initialise()
Definition: Globals.cpp:78
Definition: Inform.h:42
Ippl * ippl
Definition: Main.cpp:60
Inform * gmsg
Definition: Main.cpp:61