@@ -80,7 +80,7 @@ SST::Core::Serialization::serialize_impl<Link*>::operator()(Link*& s, serializer
8080 // Need a pointer to my simulation object
8181 Simulation_impl* sim = Simulation_impl::getSimulation ();
8282
83- // In order to uniquely identify links on restart , we need to
83+ // For restarts that use the same parallelism , we need to
8484 // track the rank of the link and its pair link. For regular
8585 // links, they are the same, but for sync link pairs, the pair
8686 // link will be on a different rank. For self links, this
@@ -109,53 +109,14 @@ SST::Core::Serialization::serialize_impl<Link*>::operator()(Link*& s, serializer
109109
110110 SST_SER (type);
111111
112- /*
113- Unique Identifiers
114-
115- For non-selflinks, we need to be able to create a unique
116- identifier so we can connect the pairs on restart. The
117- unique identifiers are created using the MPI rank and point
118- of the link cast as a uintptr_t.
119-
120- For regular links, we only store the rank once since both
121- links in the pair are on the same rank.
122-
123- For SYNC links, the local link only knows the remote link by
124- it's pair link, so we will use that pointer for the unique
125- ID.
126-
127- For self links, no rank info is stored since we don't need
128- to create a unique ID
129- */
130-
131112 if ( type == SYNC || type == REG ) {
132113 SST_SER (my_rank);
133114
134- uintptr_t ptr;
135- if ( type == SYNC )
136- ptr = reinterpret_cast <uintptr_t >(s->pair_link );
137- else
138- ptr = reinterpret_cast <uintptr_t >(s);
139-
140- SST_SER (ptr);
141-
142115 if ( type == SYNC ) {
143- // The unique ID for the remote links is constructed from
144- // the rank of the remote pair link and its pointer on
145- // that rank. The remote pointer is stored in
146- // delivery_info and we can get the remote rank from the
147- // sync queue.
116+ // Get rank for pair
148117 SyncQueue* q = dynamic_cast <SyncQueue*>(s->send_queue );
149118 pair_rank = q->getToRank ();
150119 SST_SER (pair_rank);
151- SST_SER (s->delivery_info );
152- }
153- else {
154- // Unique ID for my pair link is my rank and pair_link
155- // pointer. Rank is already stored, just store pair
156- // pointer
157- uintptr_t pair_ptr = reinterpret_cast <uintptr_t >(s->pair_link );
158- SST_SER (pair_ptr);
159120 }
160121 } // if ( type == SYNC || type == REG )
161122
@@ -280,35 +241,28 @@ SST::Core::Serialization::serialize_impl<Link*>::operator()(Link*& s, serializer
280241 */
281242 bool is_orig_sync = (type == 3 );
282243
283- /*
284- Unique identifiers
285-
286- Get the ranks and tags for this link and its pair link
287- */
288244 RankInfo my_restart_rank = sim->getRank ();
289245 RankInfo pair_restart_rank = my_restart_rank;
290246
291- uintptr_t my_tag;
292- uintptr_t pair_tag;
293247
294248 if ( type == SYNC || type == REG ) {
295249 SST_SER (my_rank);
296- SST_SER (my_tag);
297250
298251 if ( type == SYNC )
299252 SST_SER (pair_rank);
300253 else
301254 pair_rank = my_rank;
302-
303- SST_SER (pair_tag);
304255 }
305256
306257
258+ LinkId_t link_id;
259+ SST_SER (link_id);
260+
307261 /*
308262 Determine current sync state
309263 */
310264 if ( type != SELF ) {
311- pair_restart_rank = sim->getRankForLinkOnRestart (pair_rank, pair_tag );
265+ pair_restart_rank = sim->getRankForLinkOnRestart (pair_rank, link_id );
312266
313267 // If pair_restart_rank.rank == UNASSIGNED, then we have
314268 // the same paritioning as the checkpoint and the ranks
@@ -318,6 +272,7 @@ SST::Core::Serialization::serialize_impl<Link*>::operator()(Link*& s, serializer
318272
319273 bool is_restart_sync = (my_restart_rank != pair_restart_rank);
320274
275+
321276 /*
322277 Create or get link from tracker
323278
@@ -330,14 +285,12 @@ SST::Core::Serialization::serialize_impl<Link*>::operator()(Link*& s, serializer
330285 ser.unpacker ().report_new_pointer (reinterpret_cast <uintptr_t >(s));
331286 }
332287 else {
333- auto & link_tracker = sim->link_restart_tracking ;
334- std::pair<int , uintptr_t > my_unique_id = std::make_pair (my_rank.rank , my_tag);
335- std::pair<int , uintptr_t > pair_unique_id = std::make_pair (pair_rank.rank , pair_tag);
288+ auto & link_tracker = sim->link_restart_tracking ;
336289
337- if ( !is_restart_sync && link_tracker.count (my_unique_id ) ) {
290+ if ( !is_restart_sync && link_tracker.count (link_id ) ) {
338291 // Get my link and erase it from the map
339- s = link_tracker[my_unique_id ];
340- link_tracker.erase (my_unique_id );
292+ s = link_tracker[link_id ];
293+ link_tracker.erase (link_id );
341294 }
342295 else {
343296 // Create a link pair and set s to the left link
@@ -350,11 +303,11 @@ SST::Core::Serialization::serialize_impl<Link*>::operator()(Link*& s, serializer
350303 s->pair_link ->setLatency (0 );
351304
352305 // Put my pair link in the tracking map
353- link_tracker[pair_unique_id ] = s->pair_link ;
306+ link_tracker[link_id ] = s->pair_link ;
354307 }
355308 }
356309
357- SST_SER ( s->id ) ;
310+ s->id = link_id ;
358311
359312 /*
360313 Get the metadata for the link
@@ -462,17 +415,15 @@ SST::Core::Serialization::serialize_impl<Link*>::operator()(Link*& s, serializer
462415 s->pair_link ->tag = s->tag ;
463416
464417 s->pair_link ->defaultTimeBase = 1 ;
418+ s->pair_link ->id = s->id ;
465419
466- // Need to register with the SyncManager, but first
467- // need to create a unique name
468- std::string uname = s->createUniqueGlobalLinkName (my_rank, my_tag, pair_rank, pair_tag);
469- ActivityQueue* sync_q =
470- sim->syncManager ->registerLink (pair_restart_rank, my_restart_rank, uname, s->pair_link );
471- s->send_queue = sync_q;
420+ // Need to register with the SyncManager
421+ ActivityQueue* sync_q = sim->syncManager ->registerLink (pair_restart_rank, my_restart_rank, s->pair_link );
422+ s->send_queue = sync_q;
472423 }
473424 } break ;
474425 case serializer::MAP:
475- // TODO: Implement Link mapping mode
426+ // No current plans to make Links mappable
476427 break ;
477428 }
478429}
0 commit comments