@@ -2,7 +2,9 @@ module data_partition_test
22 ! ! author: Damian Rouson
33 ! !
44 ! ! summary: verify data partitioning across images and data gathering
5- use vegetables, only: result_t, test_item_t, describe, it, assert_equals, assert_that
5+ use vegetables, only: &
6+ result_t, input_t, integer_input_t, test_item_t, & ! types
7+ describe, it, assert_equals, assert_that, example ! functions
68 use data_partition_interface, only : data_partition
79 use iso_fortran_env, only : real64
810 implicit none
@@ -11,7 +13,7 @@ module data_partition_test
1113 public :: test_data_partition
1214
1315 type (data_partition) partition
14- integer , parameter :: num_particles= 31 , gatherer= 1 , num_steps= 9
16+ integer , parameter :: num_particles= 31 , gatherer= 1 , num_steps= 9 , dummy = 0
1517
1618contains
1719
@@ -24,31 +26,31 @@ function test_data_partition() result(tests)
2426
2527 associate( me= >this_image() )
2628 associate( my_first= >partition% first(me), my_last= >partition% last(me) )
27- ! do iteration=1,num_steps
28- tests = describe( &
29- " data_partition class " , &
30- [it( &
31- " partitions data in nearly even blocks " , &
32- verify_block_partitioning), &
33- it( &
34- " all data partitioned across all images without data loss " , &
35- verify_all_particles_partitioned), &
36- it( &
37- " 1D real array gathered on all images " , &
38- verify_all_gather_1D_real_array), &
39- it( &
40- " dimension 1 of 2D real array gathered on all images witout dim argument" , &
41- verify_all_gather_2D_real_array) , &
42- it( &
43- " dimension 1 of 2D real array gathered on all images with dim argument " , &
44- verify_all_gather_2D_real_array_dim1) , &
45- it( &
46- " dimension 1 of 2D real array gathered onto result_image with dim argument " , &
47- verify_gather_2D_real_array_dim1), &
48- it( &
49- " distributes all particles without losing any " , &
50- verify_all_particles_partitioned )])
51- ! end do
29+ tests = describe( &
30+ " data_partition class " , &
31+ [it( &
32+ " partitions data in nearly even blocks " , &
33+ verify_block_partitioning) , &
34+ it( &
35+ " all data partitioned across all images without data loss " , &
36+ verify_all_particles_partitioned) , &
37+ it( &
38+ " 1D real array gathered on all images " , &
39+ [example(integer_input_t(dummy)), example(integer_input_t(dummy))] , &
40+ verify_all_gather_1D_real_array), &
41+ it( &
42+ " dimension 1 of 2D real array gathered on all images witout dim argument" , &
43+ [example(integer_input_t(dummy)), example(integer_input_t(dummy))] , &
44+ verify_all_gather_2D_real_array), &
45+ it( &
46+ " dimension 1 of 2D real array gathered on all images with dim argument " , &
47+ [example(integer_input_t(dummy)), example(integer_input_t(dummy))], &
48+ verify_all_gather_2D_real_array_dim1) , &
49+ it( &
50+ " dimension 1 of 2D real array gathered onto result_image with dim argument " , &
51+ [example(integer_input_t(dummy)), example(integer_input_t(dummy))] , &
52+ verify_gather_2D_real_array_dim1 )])
53+
5254 end associate
5355 end associate
5456 end function
@@ -88,12 +90,16 @@ function verify_all_particles_partitioned() result(result_)
8890 end associate
8991 end function
9092
91- function verify_all_gather_1D_real_array () result(result_)
93+ function verify_all_gather_1D_real_array (unused ) result(result_)
9294 type (data_partition) partition
95+ class(input_t), intent (in ) :: unused
9396 type (result_t) result_
9497 real (real64) :: particle_scalar(num_particles)
9598 real (real64), parameter :: junk=- 12345._real64 , expected= 1._real64
9699
100+ associate( no_op = > unused) ! eliminate unused-variable warning
101+ end associate
102+
97103 associate(me = > this_image())
98104 associate( first= >partition% first(me), last= >partition% last(me) )
99105
@@ -109,13 +115,17 @@ function verify_all_gather_1D_real_array() result(result_)
109115 end associate
110116 end function
111117
112- function verify_all_gather_2D_real_array () result(result_)
118+ function verify_all_gather_2D_real_array (unused ) result(result_)
119+ class(input_t), intent (in ) :: unused
113120 type (data_partition) partition
114121 type (result_t) result_
115122 integer , parameter :: vec_space_dim= 3
116123 real (real64) particle_vector(vec_space_dim, num_particles)
117124 real (real64), parameter :: junk=- 12345._real64 , expected= 1._real64
118125
126+ associate( no_op = > unused) ! eliminate unused-variable warning
127+ end associate
128+
119129 associate(me = > this_image())
120130 associate( first= >partition% first(me), last= >partition% last(me) )
121131
@@ -131,13 +141,17 @@ function verify_all_gather_2D_real_array() result(result_)
131141 end associate
132142 end function
133143
134- function verify_all_gather_2D_real_array_dim1 () result(result_)
144+ function verify_all_gather_2D_real_array_dim1 (unused ) result(result_)
145+ class(input_t), intent (in ) :: unused
135146 type (data_partition) partition
136147 type (result_t) result_
137148 integer , parameter :: vec_space_dim= 3
138149 real (real64) :: vector_transpose(num_particles, vec_space_dim)
139150 real (real64), parameter :: junk=- 12345._real64 , expected= 1._real64
140151
152+ associate( no_op = > unused) ! eliminate unused-variable warning
153+ end associate
154+
141155 associate(me = > this_image())
142156 associate( first= >partition% first(me), last= >partition% last(me) )
143157
@@ -153,13 +167,17 @@ function verify_all_gather_2D_real_array_dim1() result(result_)
153167 end associate
154168 end function
155169
156- function verify_gather_2D_real_array_dim1 () result(result_)
170+ function verify_gather_2D_real_array_dim1 (unused ) result(result_)
171+ class(input_t), intent (in ) :: unused
157172 type (data_partition) partition
158173 type (result_t) result_
159174 integer , parameter :: vec_space_dim= 3
160175 real (real64) :: vector_transpose(num_particles, vec_space_dim)
161176 real (real64), parameter :: junk=- 12345._real64 , expected= 1._real64
162177
178+ associate( no_op = > unused) ! eliminate unused-variable warning
179+ end associate
180+
163181 associate(me = > this_image())
164182 associate( first= >partition% first(me), last= >partition% last(me) )
165183
0 commit comments