11
11
import logging
12
12
import mpisppy .log
13
13
14
- from mpisppy .cylinders .spcommunicator import RecvArray , SendArray , SPCommunicator
14
+ from mpisppy .cylinders .spcommunicator import RecvArray , SPCommunicator
15
15
from math import inf
16
16
17
17
from mpisppy import global_toc
@@ -32,9 +32,6 @@ class Hub(SPCommunicator):
32
32
_hub_algo_best_bound_provider = False
33
33
34
34
def __init__ (self , spbase_object , fullcomm , strata_comm , cylinder_comm , communicators , options = None ):
35
- # The extensions will be registered in SPCommunicator.__init__
36
- self .extension_recv = set ()
37
-
38
35
super ().__init__ (spbase_object , fullcomm , strata_comm , cylinder_comm , communicators , options = options )
39
36
40
37
logger .debug (f"Built the hub object on global rank { fullcomm .Get_rank ()} " )
@@ -80,51 +77,6 @@ def current_iteration(self):
80
77
def main (self ):
81
78
pass
82
79
83
- def register_extension_recv_field (self , field : Field , strata_rank : int , buf_len : int = - 1 ) -> RecvArray :
84
- """
85
- Register an extensions interest in the given field from the given spoke. The hub
86
- is then responsible for updating this field into a local buffer prior to the call
87
- to the extension sync_with_spokes function.
88
- """
89
- key = self ._make_key (field , strata_rank )
90
- if key not in self .receive_buffers :
91
- # if it is not already registered, we need to update the local buffer
92
- self .extension_recv .add (key )
93
- ## End if
94
- ra = self .register_recv_field (field , strata_rank , buf_len )
95
- return ra
96
-
97
- def register_extension_send_field (self , field : Field , buf_len : int ) -> SendArray :
98
- """
99
- Register a field with the hub that an extension will be making available to spokes. Returns a
100
- buffer that is usable for sending the desired values. The extension is responsible for calling
101
- the hub publish_extension_field when ready to send the values. Returns a SendArray to use
102
- to publish values to spokes. Meant to be called within the extension function
103
- `register_send_fields`.
104
- """
105
- return self .register_send_field (field , buf_len )
106
-
107
- def is_send_field_registered (self , field : Field ) -> bool :
108
- return field in self .send_buffers
109
-
110
- def extension_send_field (self , field : Field , buf : SendArray ):
111
- """
112
- Send the data in the SendArray `buf` which stores the Field `field`. This will make
113
- the data available to the spokes in this strata.
114
- """
115
- return self .put_send_buffer (buf , field )
116
-
117
- def sync_extension_fields (self ):
118
- """
119
- Update all registered extension fields. Safe to call even when there are no extension fields.
120
- """
121
- for key in self .extension_recv :
122
- ext_buf = self .receive_buffers [key ]
123
- (field , srank ) = self ._split_key (key )
124
- ext_buf ._is_new = self .get_receive_buffer (ext_buf , field , srank )
125
- ## End for
126
- return
127
-
128
80
def clear_latest_chars (self ):
129
81
self .latest_ib_char = None
130
82
self .latest_ob_char = None
@@ -371,7 +323,6 @@ def sync(self):
371
323
self .receive_outerbounds ()
372
324
self .receive_innerbounds ()
373
325
if self .opt .extensions is not None :
374
- self .sync_extension_fields ()
375
326
self .opt .extobject .sync_with_spokes ()
376
327
377
328
def sync_with_spokes (self ):
@@ -384,7 +335,6 @@ def sync_bounds(self):
384
335
385
336
def sync_extensions (self ):
386
337
if self .opt .extensions is not None :
387
- self .sync_extension_fields ()
388
338
self .opt .extobject .sync_with_spokes ()
389
339
390
340
def sync_nonants (self ):
@@ -485,7 +435,6 @@ def sync(self, send_nonants=True):
485
435
self .receive_innerbounds ()
486
436
# in case LShaped ever gets extensions
487
437
if getattr (self .opt , "extensions" , None ) is not None :
488
- self .sync_extension_fields ()
489
438
self .opt .extobject .sync_with_spokes ()
490
439
491
440
def is_converged (self ):
0 commit comments