allow multiple reducer runs in a directory, using PID in filenames
This commit is contained in:
parent
c1a8f7d091
commit
bf3395f297
@ -16,8 +16,10 @@
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import argparse
|
import argparse
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
global candidateRuns
|
global candidateRuns
|
||||||
|
|
||||||
@ -78,7 +80,7 @@ def main():
|
|||||||
candidateRuns += 1
|
candidateRuns += 1
|
||||||
if (time.time() - start) > args.timeout:
|
if (time.time() - start) > args.timeout:
|
||||||
raise TimeoutException
|
raise TimeoutException
|
||||||
with open(".reducer.out", 'w') as outf:
|
with open(".reducer." + str(os.getpid()) + ".out", 'w') as outf:
|
||||||
cmd = [deepstate + " --input_test_file " +
|
cmd = [deepstate + " --input_test_file " +
|
||||||
candidate + " --verbose_reads"]
|
candidate + " --verbose_reads"]
|
||||||
if whichTest is not None:
|
if whichTest is not None:
|
||||||
@ -87,7 +89,7 @@ def main():
|
|||||||
cmd += ["--no_fork"]
|
cmd += ["--no_fork"]
|
||||||
subprocess.call(cmd, shell=True, stdout=outf, stderr=outf)
|
subprocess.call(cmd, shell=True, stdout=outf, stderr=outf)
|
||||||
result = []
|
result = []
|
||||||
with open(".reducer.out", 'r') as inf:
|
with open(".reducer." + str(os.getpid()) + ".out", 'r') as inf:
|
||||||
for line in inf:
|
for line in inf:
|
||||||
result.append(line)
|
result.append(line)
|
||||||
return result
|
return result
|
||||||
@ -105,9 +107,9 @@ def main():
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def writeAndRunCandidate(test):
|
def writeAndRunCandidate(test):
|
||||||
with open(".candidate.test", 'wb') as outf:
|
with open(".candidate." + str(os.getpid()) + ".test", 'wb') as outf:
|
||||||
outf.write(test)
|
outf.write(test)
|
||||||
r = runCandidate(".candidate.test")
|
r = runCandidate(".candidate." + str(os.getpid()) + ".test")
|
||||||
return r
|
return r
|
||||||
|
|
||||||
def structure(result):
|
def structure(result):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user