Browse Source

fixed minor bugs in running the master/minon setup

master
Stephen M. McQuay 8 years ago
parent
commit
d3963db59a
2 changed files with 9 additions and 16 deletions
  1. +5
    -11
      bin/master.py
  2. +4
    -5
      bin/minion.py

+ 5
- 11
bin/master.py View File

@@ -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:


+ 4
- 5
bin/minion.py 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.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