@@ -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,7 +47,7 @@ function verify_block_partitioning() result(test_passes)
5347 logical test_passes
5448 integer my_particles
5549
56- associate( me= >this_image() )
50+ associate( me= >this_image(), partition = > data_partition_t(cardinality = num_particles) )
5751 associate( my_first= >partition% first(me), my_last= >partition% last(me) )
5852 my_particles = my_last - my_first + 1
5953 associate( ni= >num_images() )
@@ -63,14 +57,15 @@ function verify_block_partitioning() result(test_passes)
6357 end associate
6458 end associate
6559 end associate
60+
6661 end function
6762
6863 function verify_default_image_number () result(test_passes)
6964 ! ! Verify that the first and last functions assume image_number == this_image() if image_number is not present
7065 type (data_partition_t) partition
7166 logical test_passes
7267
73- associate( me= >this_image() )
68+ associate( me= >this_image(), partition = > data_partition_t(cardinality = num_particles) )
7469 test_passes = partition% first() == partition% first(me) .and. partition% last() == partition% last(me)
7570 end associate
7671 end function
@@ -82,7 +77,7 @@ function verify_all_particles_partitioned() result(test_passes)
8277 logical test_passes
8378 integer particles
8479
85- associate(me = > this_image( ))
80+ associate( me = >this_image(), partition = > data_partition_t(cardinality = num_particles ))
8681 associate( my_first= >partition% first(me), my_last= >partition% last(me) )
8782 particles = my_last - my_first + 1
8883 call co_sum(particles)
@@ -97,7 +92,7 @@ function verify_all_gather_1D_real_array() result(test_passes)
9792 real (real64) :: particle_scalar(num_particles)
9893 real (real64), parameter :: junk=- 12345._real64 , expected= 1._real64
9994
100- associate(me = > this_image( ))
95+ associate( me = >this_image(), partition = > data_partition_t(cardinality = num_particles ))
10196 associate( first= >partition% first(me), last= >partition% last(me) )
10297 particle_scalar(first:last) = expected ! ! values to be gathered
10398 particle_scalar(1 :first-1 ) = junk ! ! values to be overwritten by the gather
@@ -115,7 +110,7 @@ function verify_all_gather_2D_real_array() result(test_passes)
115110 real (real64) particle_vector(vec_space_dim, num_particles)
116111 real (real64), parameter :: junk=- 12345._real64 , expected= 1._real64
117112
118- associate(me = > this_image( ))
113+ associate( me = >this_image(), partition = > data_partition_t(cardinality = num_particles ))
119114 associate( first= >partition% first(me), last= >partition% last(me) )
120115
121116 particle_vector(:, first:last) = expected ! ! values to be gathered
@@ -134,7 +129,7 @@ function verify_all_gather_2D_real_array_dim1() result(test_passes)
134129 real (real64) :: vector_transpose(num_particles, vec_space_dim)
135130 real (real64), parameter :: junk=- 12345._real64 , expected= 1._real64
136131
137- associate(me = > this_image( ))
132+ associate( me = >this_image(), partition = > data_partition_t(cardinality = num_particles ))
138133 associate( first= >partition% first(me), last= >partition% last(me) )
139134
140135 vector_transpose(first:last, :) = expected ! ! values to be gathered
@@ -156,7 +151,7 @@ function verify_gather_2D_real_array_dim1() result(test_passes)
156151 real (real64) :: vector_transpose(num_particles, vec_space_dim)
157152 real (real64), parameter :: junk=- 12345._real64 , expected= 1._real64
158153
159- associate(me = > this_image( ))
154+ associate( me = >this_image(), partition = > data_partition_t(cardinality = num_particles ))
160155 associate( first= >partition% first(me), last= >partition% last(me) )
161156
162157 vector_transpose(first:last, :) = expected ! ! values to be gathered
0 commit comments