Ejemplo n.º 1
0
def launch(command):
    """ launch mechanism for prepared launch command"""
    mapper = Mapper()
    subproc = mapper._Mapper__launch(command)
   #pid = subproc.pid
    error = subproc.wait()           # block until all done
    if error: raise IOError, "launch failed: %s" % command
    return error
Ejemplo n.º 2
0
def launch(command):
    """ launch mechanism for prepared launch command"""
    mapper = Mapper()
    subproc = mapper._Mapper__launch(command)
    #pid = subproc.pid
    error = subproc.wait()  # block until all done
    if error: raise IOError("launch failed: %s" % command)
    return error
Ejemplo n.º 3
0
    def __init__(self, *args, **kwds):
        """\nNOTE: if number of nodes is not given, will try to grab the number
of nodes from the associated scheduler, and failing will count the local cpus.
If workdir is not given, will default to scheduler's workdir or $WORKDIR.
If scheduler is not given, will default to only run on the current node.
If pickle is not given, will attempt to minimially use TemporaryFiles.

For more details, see the docstrings for the "map" method, or the man page
for the associated launcher (e.g mpirun, mpiexec).
        """
        Mapper.__init__(self, *args, **kwds)
        self.scatter = bool(kwds.get('scatter', False)) #XXX: hang w/ nodes=1 ?
       #self.nodes = kwds.get('nodes', None)
        if not len(args) and not kwds.has_key('nodes'):
            if self.scheduler:
                self.nodes = self.scheduler.nodes
            else:
                self.nodes = cpu_count()
        return
Ejemplo n.º 4
0
 def map(self, func, *args, **kwds):
     return Mapper.map(self, func, *args, **kwds)
Ejemplo n.º 5
0
 def __init__(self, *args, **kwds):
     Mapper.__init__(self, *args, **kwds)
     self.nodes = 1  # always has one node... it's serial!
     return
Ejemplo n.º 6
0
 def __init__(self, *args, **kwds):
     Mapper.__init__(self, *args, **kwds)
     self.nodes = 1 # always has one node... it's serial!
     return
Ejemplo n.º 7
0
 def map(self, func, *args, **kwds):
     return Mapper.map(self, func, *args, **kwds)