You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let __lamellar_data: std::sync::Arc<#am_name #ty_generics> = std::sync::Arc::new(#lamellar::deserialize(&bytes,true).expect("can deserialize into remote active message"));
162
+
let __lamellar_data: std::sync::Arc<#am_name #ty_generics> = std::sync::Arc::new(#lamellar::deserialize(&bytes).expect("can deserialize into remote active message"));
163
163
<#am_name #ty_generics as #lamellar::active_messaging::DarcSerde>::des(&__lamellar_data,cur_pe);
Copy file name to clipboardExpand all lines: src/active_messaging.rs
+14-16Lines changed: 14 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -438,22 +438,20 @@
438
438
//! }
439
439
//! }
440
440
//!
441
-
//! fn main(){
442
-
//! let world = lamellar::LamellarWorldBuilder::new().build();
443
-
//! let my_pe = world.my_pe();
444
-
//! let num_pes = world.num_pes();
445
-
//! //Send initial message to right neighbor
446
-
//! let next_pe = (my_pe + 1) % num_pes; //account for wrap arround
447
-
//! let request = world.exec_am_pe(
448
-
//! next_pe,
449
-
//! RingAm {
450
-
//! original_pe: my_pe
451
-
//! }
452
-
//! );
453
-
//! //wait for the request to complete
454
-
//! let results = request.block();
455
-
//! println!("PE {my_pe} {results:?}");
456
-
//! }
441
+
//! let world = lamellar::LamellarWorldBuilder::new().build();
442
+
//! let my_pe = world.my_pe();
443
+
//! let num_pes = world.num_pes();
444
+
//! //Send initial message to right neighbor
445
+
//! let next_pe = (my_pe + 1) % num_pes; //account for wrap arround
446
+
//! let request = world.exec_am_pe(
447
+
//! next_pe,
448
+
//! RingAm {
449
+
//! original_pe: my_pe
450
+
//! }
451
+
//! );
452
+
//! //wait for the request to complete
453
+
//! let results = request.block();
454
+
//! println!("PE {my_pe} {results:?}");
457
455
//!```
458
456
//! The key thing to notice in this example is how we wait for a request to finish will change depending on the context we are executing in.
459
457
//! When we are in the active message we are already in an asynchronous context so we can simply `await` the future returned to us by the `exec_am_pe()` call.
0 commit comments