File: which.py

package info (click to toggle)
pyina 0.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 548 kB
  • sloc: python: 2,666; makefile: 34
file content (61 lines) | stat: -rwxr-xr-x 1,390 bytes parent folder | download
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env python
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 1997-2016 California Institute of Technology.
# Copyright (c) 2016-2025 The Uncertainty Quantification Foundation.
# License: 3-clause BSD.  The full license text is available at:
#  - https://github.com/uqfoundation/pyina/blob/master/LICENSE

__doc__ = """
# check which python mpirun is executing
# To run (in parallel):

mpiexec -np 1 python which.py
"""

import sys
print((sys.version))
print((sys.executable))

try:
    import mpi4py
    print(("mpi4py %s is installed" % getattr(mpi4py, '__version__', '')))
except ImportError:
    print("mpi4py not installed")
    exit()
except:
    print("mpi4py install broken")
    exit()

try:
    import pathos
    print(("pathos %s is installed" % getattr(pathos, '__version__', '')))
except ImportError:
    print("pathos not installed")
    exit()
except:
    print("pathos install broken")
    exit()

try:
    import numpy
    import dill
    import pox
    print("all dependencies are installed")
except ImportError:
    print("all dependencies not installed")
    exit()
except:
    print("dependency install broken")
    exit()

try:
    import pyina
    print(("pyina %s is installed" % getattr(pyina, '__version__', '')))
except ImportError:
    print("pyina not installed")
except:
    print("pyina install broken")


# End of file