@@ -252,6 +252,16 @@ def main(self):
252
252
"""
253
253
pass
254
254
255
+ def sync (self ):
256
+ """ Every hub/spoke may have a sync function
257
+ """
258
+ pass
259
+
260
+ def is_converged (self ):
261
+ """ Every hub/spoke may have a is_converged function
262
+ """
263
+ return False
264
+
255
265
def finalize (self ):
256
266
""" Every hub/spoke may have a finalize function,
257
267
which does some final calculations/flushing to
@@ -384,13 +394,6 @@ def get_receive_buffer(self,
384
394
buf ._is_new = False
385
395
return False
386
396
387
- def update_receive_buffers (self ):
388
- for (key , recv_buf ) in self .receive_buffers .items ():
389
- field , rank = self ._split_key (key )
390
- self .get_receive_buffer (recv_buf , field , rank )
391
- ## End for
392
- return
393
-
394
397
def update_nonant_bounds (self ):
395
398
""" update the bounds on the nonanticipative variables based on
396
399
Field.NONANT_LOWER_BOUNDS and Field.NONANT_UPPER_BOUNDS. The lower and
@@ -426,23 +429,25 @@ def update_nonant_bounds(self):
426
429
if bounds_modified > 0 :
427
430
global_toc (f"{ self .__class__ .__name__ } : tightened { int (bounds_modified )} variable bounds" , self .cylinder_rank == 0 )
428
431
429
- def update_innerbounds (self ):
430
- """ Update the inner bounds after receiving them from the spokes
432
+ def receive_innerbounds (self ):
433
+ """ Get inner bounds from inner bound providers
431
434
"""
432
- logger .debug (f"{ self .__class__ .__name__ } is trying to update from InnerBounds" )
435
+ logger .debug (f"{ self .__class__ .__name__ } is trying to receive from InnerBounds" )
433
436
for idx , cls , recv_buf in self .receive_field_spcomms [Field .OBJECTIVE_INNER_BOUND ]:
434
- if recv_buf .is_new ():
437
+ is_new = self .get_receive_buffer (recv_buf , Field .OBJECTIVE_INNER_BOUND , idx )
438
+ if is_new :
435
439
bound = recv_buf [0 ]
436
440
logger .debug ("!! new InnerBound to opt {}" .format (bound ))
437
441
self .BestInnerBound = self .InnerBoundUpdate (bound , cls , idx )
438
442
logger .debug (f"{ self .__class__ .__name__ } back from InnerBounds" )
439
443
440
- def update_outerbounds (self ):
441
- """ Update the outer bounds after receiving them from the spokes
444
+ def receive_outerbounds (self ):
445
+ """ Get outer bounds from outer bound providers
442
446
"""
443
- logger .debug (f"{ self .__class__ .__name__ } is trying to update from OuterBounds" )
447
+ logger .debug (f"{ self .__class__ .__name__ } is trying to receive from OuterBounds" )
444
448
for idx , cls , recv_buf in self .receive_field_spcomms [Field .OBJECTIVE_OUTER_BOUND ]:
445
- if recv_buf .is_new ():
449
+ is_new = self .get_receive_buffer (recv_buf , Field .OBJECTIVE_OUTER_BOUND , idx )
450
+ if is_new :
446
451
bound = recv_buf [0 ]
447
452
logger .debug ("!! new OuterBound to opt {}" .format (bound ))
448
453
self .BestOuterBound = self .OuterBoundUpdate (bound , cls , idx )
@@ -485,4 +490,3 @@ def initialize_bound_values(self):
485
490
self .BestOuterBound = inf
486
491
self ._inner_bound_update = lambda new , old : (new > old )
487
492
self ._outer_bound_update = lambda new , old : (new < old )
488
-
0 commit comments