Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Eijkhout committed Apr 26, 2018
1 parent be6cdde commit 5043154
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 7 deletions.
3 changes: 2 additions & 1 deletion README
Expand Up @@ -3,6 +3,7 @@ This is the README file for the
PyLauncher

by

Victor Eijkhout
eijkhout@tacc.utexas.edu

Expand All @@ -17,7 +18,7 @@ Sources

The latest version of the pylauncher is always available from the
repository:
https://bitbucket.org/VictorEijkhout/pylauncher
https://github.com/TACC/pylauncher

The only required sources for running are pylaucher.py and hostlist.py
(if the latter is already installed on your system you don't even need that.)
Expand Down
2 changes: 1 addition & 1 deletion examples/resume/jobscr_resume
Expand Up @@ -9,5 +9,5 @@
#SBATCH -A A-ccsc

module load python
#PYTHONPATH=..:${PYTHONPATH} python example_classic_launcher.py

PYTHONPATH=../..:${PYTHONPATH} python example_resume_launcher.py
9 changes: 8 additions & 1 deletion examples/resume/jobscr_start
Expand Up @@ -14,5 +14,12 @@
#SBATCH -A A-ccsc

module load python
##
## first make the commandlines files
##
PYTHONPATH=../../:${PYTHONPATH} python ../make_commandlines.py 1000 10 20

##
## then run the launcher
##
PYTHONPATH=../../:${PYTHONPATH} python example_classic_launcher.py
#PYTHONPATH=..:${PYTHONPATH} python example_resume_launcher.py
18 changes: 14 additions & 4 deletions pylauncher.py
@@ -1,5 +1,5 @@
docstring = \
"""pylauncher.py version 2.5 UNRELEASED
"""pylauncher.py version 2.6 UNRELEASED
A python based launcher utility for packaging sequential or
low parallel jobs in one big parallel job
Expand All @@ -10,6 +10,8 @@

changelog = """
Change log
2.6
- better host detection for s2-skx
2.5
- incorporates Stampede2, minor other edits
2.4
Expand Down Expand Up @@ -97,7 +99,7 @@ def NoRandomDir():
shutil.rmtree(dirname)
return dirname
def MakeRandomDir():
dirname = NoRandomDir()
dirname = RandomDir()
if not os.path.isdir(dirname): os.mkdir(dirname)
return dirname
def RandomFile(base=""):
Expand Down Expand Up @@ -1434,6 +1436,14 @@ def ClusterName():
"""Assuming that a node name is along the lines of ``c123-456.cluster.tacc.utexas.edu``
this returns the second member. Otherwise it returns None.
"""
# name detection based on environment variables
if "TACC_SYSTEM" in os.environ:
system = os.environ["TACC_SYSTEM"]
if "TACC_NODE_TYPE" in os.environ:
system += "-" + os.environ["TACC_NODE_TYPE"]
return system

# name detection by splitting TACC hostname
longname = HostName(); namesplit = longname.split(".")
# case: mic on stampede
nodesplit = namesplit[0].split("-")
Expand Down Expand Up @@ -1486,7 +1496,7 @@ def HostListByName(**kwargs):
return SLURMHostList(tag=".maverick.tacc.utexas.edu",**kwargs)
elif cluster=="stampede":
return SLURMHostList(tag=".stampede.tacc.utexas.edu",**kwargs)
elif cluster=="stampede2":
elif cluster in ["stampede2","stampede2-skx"]:
return SLURMHostList(tag=".stampede2.tacc.utexas.edu",**kwargs)
elif cluster=="mic":
return HostList( ["localhost" for i in range(60)] )
Expand Down Expand Up @@ -3185,7 +3195,7 @@ def testParamJob():
}
""")
os.system("cd %s && mpicc -o %s %s.c" % (testdir,testprog_name,testprog_name))
os.system("/bin/rm -rf %s" % Executor.default_workdir)
###??? os.system("/bin/rm -rf %s" % Executor.default_workdir)
#
# fn = RandomFile(); ntask = 10
# with open(fn,"w") as commandfile:
Expand Down
10 changes: 10 additions & 0 deletions scripts/cluster.py
@@ -0,0 +1,10 @@
#!/usr/bin/env python

from pylauncher import *

print "Detecting cluster name:",ClusterName()

print "Host list",HostListByName()

pool = DefaultHostPool()
print "Default pool has %d cores" % len(pool)

0 comments on commit 5043154

Please sign in to comment.