@@ -26,24 +26,18 @@ pure function subject() result(specimen)
2626 function results () result(test_results)
2727 type (test_result_t), allocatable :: test_results(:)
2828
29- call partition% define_partitions(cardinality= num_particles)
30-
31- associate( me= >this_image() )
32- associate( my_first= >partition% first(me), my_last= >partition% last(me) )
33- test_results = [ &
34- test_result_t(" partitioning data in nearly even blocks" , verify_block_partitioning()), &
35- test_result_t(" default image_number is this_image()" , verify_default_image_number()), &
36- test_result_t(" partitioning all data across all images without data loss" , verify_all_particles_partitioned()), &
37- test_result_t(" gathering a 1D real array onto all images" , verify_all_gather_1D_real_array()), &
38- test_result_t(" gathering dimension 1 of 2D real array onto all images witout dim argument" , &
39- verify_all_gather_2D_real_array()), &
40- test_result_t(" gathering dimension 1 of 2D real array onton all images with dim argument" , &
41- verify_all_gather_2D_real_array_dim1()), &
42- test_result_t(" gathering dimension 1 of 2D real array onto result_image with dim argument" , &
43- verify_gather_2D_real_array_dim1()) &
44- ]
45- end associate
46- end associate
29+ test_results = [ &
30+ test_result_t(" partitioning data in nearly even blocks" , verify_block_partitioning()), &
31+ test_result_t(" default image_number is this_image()" , verify_default_image_number()), &
32+ test_result_t(" partitioning all data across all images without data loss" , verify_all_particles_partitioned()), &
33+ test_result_t(" gathering a 1D real array onto all images" , verify_all_gather_1D_real_array()), &
34+ test_result_t(" gathering dimension 1 of 2D real array onto all images witout dim argument" , &
35+ verify_all_gather_2D_real_array()), &
36+ test_result_t(" gathering dimension 1 of 2D real array onton all images with dim argument" , &
37+ verify_all_gather_2D_real_array_dim1()), &
38+ test_result_t(" gathering dimension 1 of 2D real array onto result_image with dim argument" , &
39+ verify_gather_2D_real_array_dim1()) &
40+ ]
4741 end function
4842
4943 function verify_block_partitioning () result(test_passes)
@@ -53,6 +47,8 @@ function verify_block_partitioning() result(test_passes)
5347 logical test_passes
5448 integer my_particles
5549
50+ call partition% define_partitions(cardinality= num_particles)
51+
5652 associate( me= >this_image() )
5753 associate( my_first= >partition% first(me), my_last= >partition% last(me) )
5854 my_particles = my_last - my_first + 1
@@ -63,13 +59,16 @@ function verify_block_partitioning() result(test_passes)
6359 end associate
6460 end associate
6561 end associate
62+
6663 end function
6764
6865 function verify_default_image_number () result(test_passes)
6966 ! ! Verify that the first and last functions assume image_number == this_image() if image_number is not present
7067 type (data_partition_t) partition
7168 logical test_passes
7269
70+ call partition% define_partitions(cardinality= num_particles)
71+
7372 associate( me= >this_image() )
7473 test_passes = partition% first() == partition% first(me) .and. partition% last() == partition% last(me)
7574 end associate
@@ -82,6 +81,8 @@ function verify_all_particles_partitioned() result(test_passes)
8281 logical test_passes
8382 integer particles
8483
84+ call partition% define_partitions(cardinality= num_particles)
85+
8586 associate(me = > this_image())
8687 associate( my_first= >partition% first(me), my_last= >partition% last(me) )
8788 particles = my_last - my_first + 1
@@ -97,6 +98,8 @@ function verify_all_gather_1D_real_array() result(test_passes)
9798 real (real64) :: particle_scalar(num_particles)
9899 real (real64), parameter :: junk=- 12345._real64 , expected= 1._real64
99100
101+ call partition% define_partitions(cardinality= num_particles)
102+
100103 associate(me = > this_image())
101104 associate( first= >partition% first(me), last= >partition% last(me) )
102105 particle_scalar(first:last) = expected ! ! values to be gathered
@@ -115,6 +118,8 @@ function verify_all_gather_2D_real_array() result(test_passes)
115118 real (real64) particle_vector(vec_space_dim, num_particles)
116119 real (real64), parameter :: junk=- 12345._real64 , expected= 1._real64
117120
121+ call partition% define_partitions(cardinality= num_particles)
122+
118123 associate(me = > this_image())
119124 associate( first= >partition% first(me), last= >partition% last(me) )
120125
@@ -134,6 +139,8 @@ function verify_all_gather_2D_real_array_dim1() result(test_passes)
134139 real (real64) :: vector_transpose(num_particles, vec_space_dim)
135140 real (real64), parameter :: junk=- 12345._real64 , expected= 1._real64
136141
142+ call partition% define_partitions(cardinality= num_particles)
143+
137144 associate(me = > this_image())
138145 associate( first= >partition% first(me), last= >partition% last(me) )
139146
@@ -156,6 +163,8 @@ function verify_gather_2D_real_array_dim1() result(test_passes)
156163 real (real64) :: vector_transpose(num_particles, vec_space_dim)
157164 real (real64), parameter :: junk=- 12345._real64 , expected= 1._real64
158165
166+ call partition% define_partitions(cardinality= num_particles)
167+
159168 associate(me = > this_image())
160169 associate( first= >partition% first(me), last= >partition% last(me) )
161170
0 commit comments