File: mptrunLsm

package info (click to toggle)
esys-particle 2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,284 kB
  • sloc: cpp: 77,304; python: 5,647; makefile: 1,176; sh: 10
file content (24 lines) | stat: -rw-r--r-- 615 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
#!/usr/bin/env python
from esys.lsm.util import InstallInfo
from esys.lsm.util import PathSearcher

import os
import sys

moduleName = sys.argv[1]
exec("import " + moduleName)
moduleFileName = eval(moduleName + ".__file__")

mptrun = PathSearcher().find("mpirun")
os.execv(
  mptrun,
  [
    mptrun,         # argv[0]
    "-up", "1024",  # Universe size needs to be at least as large as the total
                    # number of spawned processes.
    "-np", "1",     # Start one MPI process and the workers get spawned.
    os.path.join(InstallInfo.binDir, "mpipython"),
    moduleFileName
  ] +\
  sys.argv[2:]
)