Пример #1
0
       to implement some kind of 'deferred' mechanism or job monitoring.
 
Argument movement for the argument list and the returned results are
pickled, while the mapped function is either saved to and imported
from a temporary file (e.g. `pyina.ez_map.ez_map`), or transferred
through serialization (e.g. `pyina.ez_map.ez_map2`).  Either implementation
has it's own advantages and weaknesses, and one mapper may succeed in
a case where the other may fail.

"""

defaults = {
    'progname' : 'ezscatter',
    }
from pyina.mpi import defaults as ezdefaults
ezdefaults.update(defaults)

from .launchers import launch, mpirun_tasks, srun_tasks, aprun_tasks
from .launchers import serial_launcher, mpirun_launcher, srun_launcher
from .launchers import aprun_launcher, torque_launcher, moab_launcher
from .schedulers import torque_scheduler, moab_scheduler

HOLD = []
sleeptime = 30  #XXX: the time between checking for results

#def ez_map(func, arglist, nodes=None, launcher=None, mapper=None):
def ez_map(func, *arglist, **kwds):
    """higher-level map interface for selected mapper and launcher

maps function 'func' across arguments 'arglist'.  arguments and results
are stored and sent as pickled strings, while function 'func' is inspected
Пример #2
0
       to implement some kind of 'deferred' mechanism or job monitoring.
 
Argument movement for the argument list and the returned results are
pickled, while the mapped function is either saved to and imported
from a temporary file (e.g. `pyina.ez_map.ez_map`), or transferred
through serialization (e.g. `pyina.ez_map.ez_map2`).  Either implementation
has it's own advantages and weaknesses, and one mapper may succeed in
a case where the other may fail.

"""

defaults = {
    'progname' : 'ezscatter',
    }
from pyina.mpi import defaults as ezdefaults
ezdefaults.update(defaults)

from .launchers import launch, mpirun_tasks, srun_tasks, aprun_tasks
from .launchers import serial_launcher, mpirun_launcher, srun_launcher
from .launchers import aprun_launcher, torque_launcher, moab_launcher
from .schedulers import torque_scheduler, moab_scheduler

HOLD = []
sleeptime = 30  #XXX: the time between checking for results

#def ez_map(func, arglist, nodes=None, launcher=None, mapper=None):
def ez_map(func, *arglist, **kwds):
    """higher-level map interface for selected mapper and launcher

maps function 'func' across arguments 'arglist'.  arguments and results
are stored and sent as pickled strings, while function 'func' is inspected