Changeset 227
- Timestamp:
- 05/13/10 16:09:30 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mystic/mystic/abstract_map_solver.py
r226 r227 37 37 >>> from pyina.launchers import mpirun_launcher 38 38 >>> from pyina.mappers import equalportion_mapper 39 >>> from pyina.ez_map import ez_map 39 40 >>> NNODES = 4 40 41 >>> … … 43 44 >>> solver = NelderMeadSimplexMapSolver(len(x0)) 44 45 >>> solver.SetInitialPoints(x0) #FIXME: use batchgrid w/ bounds 45 >>> solver.SetMap Strategy(equalportion_mapper)46 >>> solver.SetMapper(ez_map, equalportion_mapper) 46 47 >>> solver.SetLauncher(mpirun_launcher, NNODES) 47 48 >>> solver.Solve(rosen, CRT(), StepMonitor=stepmon) … … 150 151 # return 151 152 152 def SetMapper(self, strategy): #XXX: should use strategy+format ? 153 """Set the mapping strategy. 154 155 Description: 156 153 def SetMapper(self, map, strategy=None): #XXX: use strategy+format ? 154 """Set the map function and the mapping strategy. 155 156 Description: 157 158 Sets a mapping function to perform the map-reduce algorithm. 157 159 Uses a mapping strategy to provide the algorithm for distributing 158 160 the work list of optimization jobs across available resources. 159 161 160 162 Inputs: 161 mapper -- mapper function (see pyina.mappers) [DEFAULT: carddealer_mapper] 162 """ 163 #XXX: allow python's 'map' to be passed 164 self._mapper = strategy 163 map -- the mapping function [DEFAULT: python_map] 164 strategy -- map strategy (see pyina.mappers) [DEFAULT: carddealer_mapper] 165 """ 166 self._map = map 167 if strategy: 168 self._mapper = strategy 165 169 #FIXME: not a true mapping function... just a dummy interface to a str 166 170 # a real mapper has map(func,*args) interface... this expects map().
Note: See TracChangeset
for help on using the changeset viewer.