@@ -26,24 +26,18 @@ pure function subject() result(specimen)
26
26
function results () result(test_results)
27
27
type (test_result_t), allocatable :: test_results(:)
28
28
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
+ ]
47
41
end function
48
42
49
43
function verify_block_partitioning () result(test_passes)
@@ -53,7 +47,7 @@ function verify_block_partitioning() result(test_passes)
53
47
logical test_passes
54
48
integer my_particles
55
49
56
- associate( me= >this_image() )
50
+ associate( me= >this_image(), partition = > data_partition_t(cardinality = num_particles) )
57
51
associate( my_first= >partition% first(me), my_last= >partition% last(me) )
58
52
my_particles = my_last - my_first + 1
59
53
associate( ni= >num_images() )
@@ -63,14 +57,15 @@ function verify_block_partitioning() result(test_passes)
63
57
end associate
64
58
end associate
65
59
end associate
60
+
66
61
end function
67
62
68
63
function verify_default_image_number () result(test_passes)
69
64
! ! Verify that the first and last functions assume image_number == this_image() if image_number is not present
70
65
type (data_partition_t) partition
71
66
logical test_passes
72
67
73
- associate( me= >this_image() )
68
+ associate( me= >this_image(), partition = > data_partition_t(cardinality = num_particles) )
74
69
test_passes = partition% first() == partition% first(me) .and. partition% last() == partition% last(me)
75
70
end associate
76
71
end function
@@ -82,7 +77,7 @@ function verify_all_particles_partitioned() result(test_passes)
82
77
logical test_passes
83
78
integer particles
84
79
85
- associate(me = > this_image( ))
80
+ associate( me = >this_image(), partition = > data_partition_t(cardinality = num_particles ))
86
81
associate( my_first= >partition% first(me), my_last= >partition% last(me) )
87
82
particles = my_last - my_first + 1
88
83
call co_sum(particles)
@@ -97,7 +92,7 @@ function verify_all_gather_1D_real_array() result(test_passes)
97
92
real (real64) :: particle_scalar(num_particles)
98
93
real (real64), parameter :: junk=- 12345._real64 , expected= 1._real64
99
94
100
- associate(me = > this_image( ))
95
+ associate( me = >this_image(), partition = > data_partition_t(cardinality = num_particles ))
101
96
associate( first= >partition% first(me), last= >partition% last(me) )
102
97
particle_scalar(first:last) = expected ! ! values to be gathered
103
98
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)
115
110
real (real64) particle_vector(vec_space_dim, num_particles)
116
111
real (real64), parameter :: junk=- 12345._real64 , expected= 1._real64
117
112
118
- associate(me = > this_image( ))
113
+ associate( me = >this_image(), partition = > data_partition_t(cardinality = num_particles ))
119
114
associate( first= >partition% first(me), last= >partition% last(me) )
120
115
121
116
particle_vector(:, first:last) = expected ! ! values to be gathered
@@ -134,7 +129,7 @@ function verify_all_gather_2D_real_array_dim1() result(test_passes)
134
129
real (real64) :: vector_transpose(num_particles, vec_space_dim)
135
130
real (real64), parameter :: junk=- 12345._real64 , expected= 1._real64
136
131
137
- associate(me = > this_image( ))
132
+ associate( me = >this_image(), partition = > data_partition_t(cardinality = num_particles ))
138
133
associate( first= >partition% first(me), last= >partition% last(me) )
139
134
140
135
vector_transpose(first:last, :) = expected ! ! values to be gathered
@@ -156,7 +151,7 @@ function verify_gather_2D_real_array_dim1() result(test_passes)
156
151
real (real64) :: vector_transpose(num_particles, vec_space_dim)
157
152
real (real64), parameter :: junk=- 12345._real64 , expected= 1._real64
158
153
159
- associate(me = > this_image( ))
154
+ associate( me = >this_image(), partition = > data_partition_t(cardinality = num_particles ))
160
155
associate( first= >partition% first(me), last= >partition% last(me) )
161
156
162
157
vector_transpose(first:last, :) = expected ! ! values to be gathered
0 commit comments