fixed minor bugs in running the master/minon setup

This commit is contained in:
Stephen M. McQuay 2011-09-27 22:08:10 -06:00
parent 0916023080
commit d3963db59a
2 changed files with 10 additions and 17 deletions

View File

@ -1,22 +1,17 @@
#!/usr/bin/env python
import sys
import os
import time
import shelve
from collections import defaultdict
from optparse import OptionParser
import logging
log = logging.getLogger("interp")
import os
from progressbar import ProgressBar, Percentage, Bar, ETA
import shelve
import sys
import time
import numpy as np
from interp.cluster import QueueManager, get_qs
from progressbar import ProgressBar, Percentage, Bar, ETA
if __name__ == '__main__':
parser = OptionParser(usage="usage: %s [options] <server> <interp count>")
@ -132,7 +127,6 @@ if __name__ == '__main__':
stats['order'] = options.order
print "%s" % stats
log.error("stats: %s", stats)
tasks_accomplished_by = defaultdict(int)
for i in results:

View File

@ -4,10 +4,9 @@ import sys
import os
from optparse import OptionParser
import numpy as np
from interp.grid.gmsh import ggrid
from interp.tools import baker_exact_3D as exact
from interp.tools import baker_exact_3D as exact, exact_me
from interp.cluster import QueueManager, get_qs
if __name__ == '__main__':
@ -41,7 +40,7 @@ if __name__ == '__main__':
if options.verbose:
print "%s: starting parse input file" % myname
g = ggrid(input_file)
g.q = np.array([exact(x) for x in g.verts])
g.values = exact_me(g.points, exact)
if options.verbose:
print "%s: done parsing input file" % myname
@ -62,7 +61,7 @@ if __name__ == '__main__':
while not tasksq.empty():
i, o, e, X = tasksq.get()
try:
a = g.run_baker(X, order=o, extra_points=e)
a = g.interpolate(X, order=o, extra_points=e)
resultsq.put((i, myname, a.qlin, a.error, a.final, exact(X)))
except Exception as e:
print X, e