@@ -516,13 +516,15 @@ TEST(NetworkTest, Callback) {
516516
517517TEST (NetworkTest, Scenario1) {
518518 // This is intended to demonstrate execution order as A B C D C D C D E
519+ // Here we create three phases, phase 1 containing A and B,
520+ // phase 2 containing phases C and D, and phase 3 containing E.
519521 Network n;
520522
521- std::shared_ptr<Region> regionA = n.addRegion (" A" , " TestNode" , " {dim: [1]}" , { 1 } );
522- std::shared_ptr<Region> regionB = n.addRegion (" B" , " TestNode" , " {dim: [1]}" , { 1 } );
523- std::shared_ptr<Region> regionC = n.addRegion (" C" , " TestNode" , " {dim: [1]}" , { 2 } );
524- std::shared_ptr<Region> regionD = n.addRegion (" D" , " TestNode" , " {dim: [1]}" , { 2 } );
525- std::shared_ptr<Region> regionE = n.addRegion (" E" , " TestNode" , " {dim: [1]}" , { 3 } );
523+ std::shared_ptr<Region> regionA = n.addRegion (" A" , " TestNode" , " {dim: [1]}" , 1 );
524+ std::shared_ptr<Region> regionB = n.addRegion (" B" , " TestNode" , " {dim: [1]}" , 1 );
525+ std::shared_ptr<Region> regionC = n.addRegion (" C" , " TestNode" , " {dim: [1]}" , 2 );
526+ std::shared_ptr<Region> regionD = n.addRegion (" D" , " TestNode" , " {dim: [1]}" , 2 );
527+ std::shared_ptr<Region> regionE = n.addRegion (" E" , " TestNode" , " {dim: [1]}" , 3 );
526528
527529 regionA->setParameterUInt64 (" computeCallback" , (UInt64)recordCompute);
528530 regionB->setParameterUInt64 (" computeCallback" , (UInt64)recordCompute);
@@ -531,9 +533,9 @@ TEST(NetworkTest, Scenario1) {
531533 regionE->setParameterUInt64 (" computeCallback" , (UInt64)recordCompute);
532534
533535 computeHistory.clear ();
534- n.run (1 , { 1 } ); // execute A, B once
535- n.run (3 , { 2 } ); // execute C, D three times
536- n.run (1 , { 3 } ); // execute E once
536+ n.run (1 , 1 ); // execute A, B once
537+ n.run (3 , 2 ); // execute C, D three times
538+ n.run (1 , 3 ); // execute E once
537539
538540 ASSERT_EQ (9u , computeHistory.size ());
539541 EXPECT_STREQ (" A" , computeHistory.at (0 ).c_str ());
@@ -545,6 +547,10 @@ TEST(NetworkTest, Scenario1) {
545547 EXPECT_STREQ (" C" , computeHistory.at (6 ).c_str ());
546548 EXPECT_STREQ (" D" , computeHistory.at (7 ).c_str ());
547549 EXPECT_STREQ (" E" , computeHistory.at (8 ).c_str ());
550+
551+
552+ n.run (1 , {1 , 2 }); // execute just phase 1 and 2
553+ n.run (1 ); // execute all phases
548554}
549555
550556/* *
@@ -695,10 +701,10 @@ TEST(NetworkTest, Scenario2) {
695701 std::shared_ptr<Region> input = n.getRegion (" INPUT" );
696702 const Array &input_data = input->getOutputData (" begin" );
697703 EXPECT_EQ (input_data.asVector <UInt32>(), initialdata);
698- n.run (1 , { 0 } ); // execute the internal INPUT region.
699- n.run (1 , { 1 } ); // execute A, B once
700- n.run (3 , { 2 } ); // execute C, D three times
701- n.run (1 , { 3 } ); // execute E once
704+ n.run (1 , 0 ); // execute the internal INPUT region.
705+ n.run (1 , 1 ); // execute A, B once
706+ n.run (3 , 2 ); // execute C, D three times
707+ n.run (1 , 3 ); // execute E once
702708
703709 // We should end with the first element incremented the same number of times
704710 // that LinkRegion was executed. This shows that the message went through
0 commit comments