Browse Source

fixed minor bugs in running the master/minon setup

master
Stephen M. McQuay 10 years ago
parent
commit
d3963db59a
  1. 16
      bin/master.py
  2. 9
      bin/minion.py

16
bin/master.py

@ -1,22 +1,17 @@
#!/usr/bin/env python
import sys
from collections import defaultdict
from optparse import OptionParser
import os
import time
from progressbar import ProgressBar, Percentage, Bar, ETA
import shelve
from collections import defaultdict
from optparse import OptionParser
import logging
log = logging.getLogger("interp")
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:

9
bin/minion.py

@ -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.grid.gmsh import ggrid
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

Loading…
Cancel
Save