dump output to text
This commit is contained in:
parent
2c98902f0d
commit
64b4eb0772
@ -21,7 +21,7 @@ log = logging.getLogger("interp")
|
||||
from interp.cluster import QueueManager, get_qs
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = OptionParser(usage = "%prog [options] <server> <destination vertexes file (pickle)> <results pickle>")
|
||||
parser = OptionParser(usage = "%prog [options] <server> <destination vertexes file (pickle)> <results output file> <dimension>")
|
||||
|
||||
parser.add_option("-v", "--verbose",
|
||||
action="store_true", dest="verbose", default=False,
|
||||
@ -36,11 +36,12 @@ if __name__ == '__main__':
|
||||
help="specify how many participants we should wait for (default: %default)")
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
if len(args) != 3:
|
||||
if len(args) != 4:
|
||||
parser.print_usage()
|
||||
sys.exit(1)
|
||||
|
||||
server, dest_verts, results_p_name = args
|
||||
server, dest_verts, results_p_name, dimension = args
|
||||
dimension = int(dimension)
|
||||
|
||||
dest_verts = pickle.load(open(dest_verts, 'r'))
|
||||
|
||||
@ -114,7 +115,13 @@ if __name__ == '__main__':
|
||||
receive_end = time.time()
|
||||
pbar.finish()
|
||||
|
||||
pickle.dump(results, open(results_p_name, 'w'))
|
||||
# pickle.dump(results, open(results_p_name, 'w'))
|
||||
o = open(results_p_name, 'w')
|
||||
for i in results:
|
||||
if dimension == 2:
|
||||
o.write("%d %d %f %f %f %f %f %f %f\n" % (i[0], i[1], i[2][0], i[2][1], i[3], i[4], i[5], i[6], i[7]))
|
||||
elif dimension == 3:
|
||||
o.write("%d %d %f %f %f %f %f %f %f %f\n" % (i[0], i[1], i[2][0], i[2][1], i[2][2], i[3], i[4], i[5], i[6], i[7]))
|
||||
|
||||
submit = submit_end - submit_start
|
||||
receive = receive_end - receive_start
|
||||
|
Loading…
Reference in New Issue
Block a user