/
__init__.py
39 lines (29 loc) · 1017 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import sys
if sys.version_info < (2, 7, 0):
raise RuntimeError("charm4py requires Python 2.7 or higher")
import atexit
import os
import subprocess
charm4py_version = "unknown"
try:
from ._version import version as charm4py_version
except:
try:
charm4py_version = subprocess.check_output(['git', 'describe'],
cwd=os.path.dirname(__file__)).rstrip().decode()
except:
pass
if os.environ.get('CHARM_NOLOAD', '0') == '0':
from .charm import charm, readonlies, Options
Reducer = charm.reducers
CkMyPe = charm.myPe
CkNumPes = charm.numPes
CkExit = charm.exit
CkAbort = charm.abort
from .entry_method import when, threaded
from .chare import Chare, Group, Array, ArrayMap
def checkCharmStarted():
if not charm.started:
print('Program is exiting but charm was not started: charm.start() was not '
'called or error happened before start')
atexit.register(checkCharmStarted)