Commit 7bcd9592 authored by Joe Lyons's avatar Joe Lyons

allow slot usage for clusterMatlab

parent 4ca6e3d2
......@@ -14,18 +14,21 @@ Run a matlab script on the YNiC cluster.
Optional arguments:
-v, --version Matlab version to use
-m, --memory Memory to reserve (defaults to cluster default)
-s, --slots Number of slots to allocate using -pe
Example of memory usage:
* clusterMatlab -m 8G /path/to/my.m""" % os.path.basename(sys.argv[0])
Examples:
* clusterMatlab -m 8G /path/to/my.m
* clusterMatlab -s 3 /path/to/my.m """ % os.path.basename(sys.argv[0])
sys.exit(exit_code)
def parse():
opts, args = getopt.getopt(sys.argv[1:],
"v:m:h",
["version=", "memory=", "help"])
"v:m:s:h",
["version=", "memory=", "slots=", "help"])
version = None
mem = ''
slot = ''
qsubargs = ''
for o, a in opts:
......@@ -34,7 +37,9 @@ def parse():
elif o in ("-h", "--help"):
usage()
elif o in ("-m", "--memory"):
qsubargs = '-l h_vmem=%s' % str(a)
mem = '-l h_vmem=%s' % str(a)
elif o in ("-s", "--slots"):
slot = '-pe smp %s' % str(a)
if len(args) < 1:
usage()
......@@ -47,6 +52,8 @@ def parse():
print "Error: Cannot determine default Matlab version (%s)" % e
sys.exit(1)
qsubargs = (mem + " " + slot)
return args, version, qsubargs
def runfile(mFile, logPath, version, qsubargs):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment