Skip to content

Commit

Permalink
Merge pull request #61 from jakirkham/use_hostname
Browse files Browse the repository at this point in the history
Specify hostname for stdout and stderr files
  • Loading branch information
jakirkham committed Jul 10, 2017
2 parents 7b11c6e + 955fd71 commit fcfcf29
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions splauncher/core.py
Expand Up @@ -35,6 +35,8 @@


def main(*argv):
hostname = os.uname()[1]

job_time = datetime.datetime.utcnow()
job_time_str = job_time.isoformat().replace(":", ".")
job_name = "splaunch_" + argv[1].replace("/", "-") + "_" + job_time_str
Expand All @@ -50,8 +52,8 @@ def main(*argv):
job_template.args = argv[2:]
job_template.jobEnvironment = os.environ
job_template.inputPath = "localhost:" + os.devnull
job_template.outputPath = "localhost:" + job_name + ".out"
job_template.errorPath = "localhost:" + job_name + ".err"
job_template.outputPath = hostname + ":" + job_name + ".out"
job_template.errorPath = hostname + ":" + job_name + ".err"
job_template.workingDirectory = os.getcwd()

process_id = s.runJob(job_template)
Expand Down

0 comments on commit fcfcf29

Please sign in to comment.