Changeset 799 for mystic


Ignore:
Timestamp:
06/23/15 10:07:07 (11 months ago)
Author:
mmckerns
Message:

update to use pathos.pools; mirror with mystic.pools

Location:
mystic
Files:
14 edited
1 moved

Legend:

Unmodified
Added
Removed
  • mystic/examples/TEST_ffitPP.py

    r776 r799  
    2020def main(): 
    2121    from mystic.solvers import DifferentialEvolutionSolver2 
    22    #from pathos.multiprocessing import ProcessingPool as Pool 
    23     from pathos.pp import ParallelPythonPool as Pool 
     22   #from pathos.pools import ProcessPool as Pool 
     23    from pathos.pools import ParallelPool as Pool 
    2424 
    2525    solver = DifferentialEvolutionSolver2(ND, NP) 
  • mystic/examples/TEST_ffitPP_b.py

    r776 r799  
    4747def main(servers,ncpus): 
    4848    from mystic.solvers import DifferentialEvolutionSolver2 
    49    #from pathos.multiprocessing import ProcessingPool as Pool 
    50     from pathos.pp import ParallelPythonPool as Pool 
     49   #from pathos.pools import ProcessPool as Pool 
     50    from pathos.pools import ParallelPool as Pool 
    5151 
    5252    solver = DifferentialEvolutionSolver2(ND, NP) 
  • mystic/examples/buckshot_example06.py

    r776 r799  
    2727# if available, use a multiprocessing worker pool 
    2828try: 
    29     from pathos.multiprocessing import ProcessingPool as Pool 
    30    #from pathos.pp import ParallelPythonPool as Pool 
     29    from pathos.pools import ProcessPool as Pool 
     30   #from pathos.pools import ParallelPool as Pool 
    3131except ImportError: 
    32     from mystic.python import PythonSerial as Pool 
     32    from mystic.pools import SerialPool as Pool 
    3333 
    3434# tools 
  • mystic/examples/lattice_example06.py

    r776 r799  
    2727# if available, use a multiprocessing worker pool 
    2828try: 
    29     from pathos.multiprocessing import ProcessingPool as Pool 
    30    #from pathos.pp import ParallelPythonPool as Pool 
     29    from pathos.pools import ProcessPool as Pool 
     30   #from pathos.pools import ParallelPool as Pool 
    3131except ImportError: 
    32     from mystic.python import PythonSerial as Pool 
     32    from mystic.pools import SerialPool as Pool 
    3333 
    3434# tools 
  • mystic/examples/mpmap_desolve.py

    r776 r799  
    2424 
    2525try: 
    26   from pathos.multiprocessing import ProcessingPool as Pool 
     26  from pathos.pools import ProcessPool as Pool 
    2727except: 
    2828  print __doc__ 
  • mystic/examples/mpmap_desolve_rosen.py

    r776 r799  
    2424 
    2525try: 
    26   from pathos.multiprocessing import ProcessingPool as Pool 
     26  from pathos.pools import ProcessPool as Pool 
    2727except: 
    2828  print __doc__ 
  • mystic/examples/test_twistedgaussian3.py

    r776 r799  
    3333    # if available, use a multiprocessing worker pool 
    3434    try: 
    35         from pathos.multiprocessing import ProcessingPool as Pool 
     35        from pathos.pools import ProcessPool as Pool 
    3636        map = Pool().map 
    3737    except ImportError: 
  • mystic/examples_UQ/MM2_surrogate_diam_batchgrid.py

    r797 r799  
    6666def optimize(cost,lower,upper,nbins): 
    6767  from mystic.tools import random_seed 
    68   from pathos.multiprocessing import ProcessingPool as Pool 
     68  from pathos.pools import ProcessPool as Pool 
    6969  random_seed(123) 
    7070 
     
    110110####################################################################### 
    111111def UQ(start,end,lower,upper): 
    112  #from pathos.multiprocessing import ProcessingPool as Pool 
    113   from pathos.multiprocessing import ThreadingPool as Pool 
     112 #from pathos.pools import ProcessPool as Pool 
     113  from pathos.pools import ThreadPool as Pool 
    114114 #from pool_helper import func_pickle  # if fails to pickle, try using a helper 
    115115 
  • mystic/examples_UQ/MM_surrogate_diam.py

    r776 r799  
    6565####################################################################### 
    6666def optimize(cost,lb,ub): 
    67   from pathos.multiprocessing import ProcessingPool as Pool 
     67  from pathos.pools import ProcessPool as Pool 
    6868  from mystic.solvers import DifferentialEvolutionSolver2 
    6969  from mystic.termination import CandidateRelativeTolerance as CRT 
  • mystic/examples_UQ/MPI2_surrogate_diam_batchgrid.py

    r776 r799  
    111111def UQ(start,end,lower,upper): 
    112112 #from pyina.launchers import Mpi as Pool 
    113   from pathos.multiprocessing import ProcessingPool as Pool 
     113  from pathos.pools import ProcessPool as Pool 
    114114 #from pool_helper import func_pickle  # if fails to pickle, try using a helper 
    115115 
  • mystic/examples_UQ/PP_surrogate_diam.py

    r776 r799  
    6565####################################################################### 
    6666def optimize(cost,lb,ub): 
    67   from pathos.pp import ParallelPythonPool as Pool 
     67  from pathos.pools import ParallelPool as Pool 
    6868  from mystic.solvers import DifferentialEvolutionSolver2 
    6969  from mystic.termination import CandidateRelativeTolerance as CRT 
  • mystic/examples_UQ/QSUB2_surrogate_diam_batchgrid.py

    r776 r799  
    111111def UQ(start,end,lower,upper): 
    112112 #from pyina.launchers import Mpi as Pool 
    113   from pathos.multiprocessing import ProcessingPool as Pool 
     113  from pathos.pools import ProcessPool as Pool 
    114114 #from pool_helper import func_pickle  # if fails to pickle, try using a helper 
    115115 
  • mystic/mystic/abstract_launcher.py

    r792 r799  
    2828 
    2929    >>> # instantiate and configure the worker pool 
    30     >>> from pathos.multiprocessing import ProcessingPool 
    31     >>> pool = ProcessingPool(nodes=4) 
     30    >>> from pathos.pools import ProcessPool 
     31    >>> pool = ProcessPool(nodes=4) 
    3232    >>> 
    3333    >>> # do a blocking map on the chosen function 
  • mystic/mystic/pools.py

    r776 r799  
    2222 
    2323    >>> # instantiate and configure the worker pool 
    24     >>> from pathos.python import PythonSerial 
    25     >>> pool = PythonSerial() 
     24    >>> from pathos.serial import SerialPool 
     25    >>> pool = SerialPool() 
    2626    >>> 
    2727    >>> # do a blocking map on the chosen function 
    28     >>> results = pool.map(pow, [1,2,3,4], [5,6,7,8]) 
     28    >>> print pool.map(pow, [1,2,3,4], [5,6,7,8]) 
    2929    >>> 
    3030    >>> # do a non-blocking map, then extract the results from the iterator 
    3131    >>> results = pool.imap(pow, [1,2,3,4], [5,6,7,8]) 
    32     >>> results = list(results) 
     32    >>> print "..." 
     33    >>> print list(results) 
     34    >>> 
     35    >>> # do one item at a time, using a pipe 
     36    >>> print pool.pipe(pow, 1, 5) 
     37    >>> print pool.pipe(pow, 2, 6) 
    3338 
    3439 
     
    4348 
    4449""" 
    45 __all__ = ['PythonSerial'] 
     50__all__ = ['SerialPool'] 
    4651 
    4752from abstract_launcher import AbstractWorkerPool 
     
    5156from __builtin__ import map as _map, apply as _apply 
    5257 
    53 class PythonSerial(AbstractWorkerPool): 
     58class SerialPool(AbstractWorkerPool): 
    5459    """ 
    5560Mapper that leverages standard (i.e. serial) python maps. 
     
    7883 
    7984 
     85# backward compatibility 
     86PythonSerial = SerialPool 
     87 
     88# EOF 
  • mystic/tests/test_solver_constraints.py

    r776 r799  
    181181 
    182182  # solver with mapper 
    183  #from pathos.multiprocessing import ProcessingPool as Pool 
    184   from mystic.python import PythonSerial as Pool 
     183 #from pathos.pools import ProcessPool as Pool 
     184  from mystic.pools import SerialPool as Pool 
    185185  map = Pool(5).map 
    186186  for solver in classes: 
Note: See TracChangeset for help on using the changeset viewer.