Changeset 793
- Timestamp:
- 06/11/15 08:27:52 (11 months ago)
- Location:
- mystic/mystic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
mystic/mystic/differential_evolution.py
r792 r793 378 378 from python_map import python_map 379 379 if self._map != python_map: 380 pass #FIXME: EvaluationMonitor fails for MPI, throws error for 'pp' 381 else: fcalls, cost = wrap_function(cost, ExtraArgs, self._evalmon) 380 #FIXME: EvaluationMonitor fails for MPI, throws error for 'pp' 381 from mystic.monitors import Null 382 evalmon = Null() 383 else: evalmon = self._evalmon 384 fcalls, cost = wrap_function(cost, ExtraArgs, evalmon) 382 385 if self._useStrictRange: 383 386 for i in range(self.nPop): -
mystic/mystic/ensemble.py
r792 r793 95 95 from python_map import python_map 96 96 if self._map != python_map: 97 pass #FIXME: EvaluationMonitor fails for MPI, throws error for 'pp' 98 else: fcalls, cost = wrap_function(cost, ExtraArgs, self._evalmon) 97 #FIXME: EvaluationMonitor fails for MPI, throws error for 'pp' 98 from mystic.monitors import Null 99 evalmon = Null() 100 else: evalmon = self._evalmon 101 fcalls, cost = wrap_function(cost, ExtraArgs, evalmon) 99 102 100 103 # set up signal handler … … 289 292 from python_map import python_map 290 293 if self._map != python_map: 291 pass #FIXME: EvaluationMonitor fails for MPI, throws error for 'pp' 292 else: fcalls, cost = wrap_function(cost, ExtraArgs, self._evalmon) 294 #FIXME: EvaluationMonitor fails for MPI, throws error for 'pp' 295 from mystic.monitors import Null 296 evalmon = Null() 297 else: evalmon = self._evalmon 298 fcalls, cost = wrap_function(cost, ExtraArgs, evalmon) 293 299 294 300 # set up signal handler -
mystic/mystic/tools.py
r791 r793 329 329 330 330 # slight break to backward compatability: renamed 'args' to 'extra_args' 331 def wrap_function(the_function, extra_args, EvaluationMonitor ):331 def wrap_function(the_function, extra_args, EvaluationMonitor, scale=1): 332 332 """bind an EvaluationMonitor and evaluation counter to a function object""" 333 # scale=-1 intended to seek min(-f) == -max(f) 333 334 ncalls = [0] 334 335 from numpy import array … … 337 338 fval = the_function(x, *extra_args) 338 339 EvaluationMonitor(x, fval) 339 return fval340 return scale*fval 340 341 return ncalls, function_wrapper 341 342
Note: See TracChangeset
for help on using the changeset viewer.