Skip to content

Commit

Permalink
updated script to work with htcondor job submittal
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 committed Oct 30, 2015
1 parent 8992d57 commit 5622f77
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions RAPIDpy/rapid.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,29 @@ def rapid_cleanup(*args):
with open(run_rapid_script, "w") as run_rapid:
run_rapid.write("#!/bin/sh\n")
run_rapid.write("cd {}\n".format(self._get_cygwin_path(os.getcwd())))
run_rapid.write("mpiexec -np {} ./rapid -ksp_type richardson\n".format(self._num_processors))
if self._num_processors > 1:
run_rapid.write("mpiexec -np {0} {1} -ksp_type richardson\n".format(self._num_processors,
local_rapid_executable_location))
else:
#htcondor will not allow mpiexec for single processor jobs
#this was added for that purpose
run_rapid.write("{} -ksp_type richardson\n".format(local_rapid_executable_location))


self._dos2unix_cygwin(run_rapid_script)
run_rapid_command = [self._cygwin_bash_exe_location, "-l", "-c",
self._get_cygwin_path(run_rapid_script)]

else:
run_rapid_command = ["mpiexec", "-n", str(self._num_processors),
local_rapid_executable_location,
#htcondor will not allow mpiexec for single processor jobs
#this was added for that purpose
run_rapid_command = [local_rapid_executable_location,
"-ksp_type", "richardson"]

if self._num_processors > 1:
run_rapid_command = ["mpiexec", "-n", str(self._num_processors),
local_rapid_executable_location,
"-ksp_type", "richardson"]

process = Popen(run_rapid_command,
stdout=PIPE, stderr=PIPE, shell=False)
Expand Down

0 comments on commit 5622f77

Please sign in to comment.