@@ -37,7 +37,9 @@ program main
3737
3838 integer , parameter :: standard_initial_value=- 1
3939
40- type (team_type), target :: home
40+ type (team_type) :: parent, child
41+
42+ if (num_images() < 8 ) error stop " I need at least 8 images to function."
4143
4244 call assert(team_number()==standard_initial_value," initial team number conforms with Fortran standard before 'change team'" )
4345
@@ -47,11 +49,17 @@ program main
4749 ! ! TODO: uncomment the above assertion after implementing support for team_number's optional argument:
4850
4951 after_change_team: block
50- associate(my_team = > mod (this_image(), 2 ) + 1 )
52+ associate(parent_team_number = > 100 + (num_images() - 1 ) / 4 , child_team_number = > 1000 + mod (num_images() - 1 , 4 ) / 2 )
5153 ! ! Prepare for forming two teams: my_team = 1 for even image numbers in the initial team; 2 for odd image numbers
52- form team(my_team,home)
53- change team(home)
54- call assert(team_number()==my_team," team number conforms with Fortran standard after 'change team'" )
54+ form team(parent_team_number,parent)
55+ change team(parent)
56+ call assert(team_number()==parent_team_number," team number conforms with Fortran standard after 'change team'" )
57+ form team (child_team_number, child)
58+ change team(child)
59+ call assert(team_number()==child_team_number," team number conforms with Fortran standard after 'change team'" )
60+ call assert(team_number(child)==child_team_number," team_number(child) conforms with Fortran standard after 'change team'" )
61+ call assert(team_number(parent)==parent_team_number," team_number(parent) conforms with Fortran standard" )
62+ end team
5563 end team
5664 call assert(team_number()==standard_initial_value," initial team number conforms with Fortran standard" )
5765 end associate
0 commit comments