1
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47#include "fc_feature_defs.inc"
48PROGRAM test_idxempty
49 USE mpi
54 USE ftest_common, ONLY: init_mpi, finish_mpi, test_abort
55 USE test_idxlist_utils, ONLY: check_idxlist, test_err_count, &
56 idxlist_pack_unpack_copy
57 IMPLICIT NONE
58
59 TYPE(xt_idxlist) :: idxempty, idxempty_copy
60 INTEGER(xt_int_kind) :: no_idx(1)
61 TYPE(xt_stripe), ALLOCATABLE :: stripes(:)
62 CHARACTER(len=*), PARAMETER :: filename = 'test_idxempty_f.f90'
63
64
65 CALL init_mpi
67
69
70 CALL check_idxlist(idxempty, no_idx(1:0))
71
72 idxempty_copy = idxlist_pack_unpack_copy(idxempty)
73
74
75 CALL check_idxlist(idxempty_copy, no_idx(1:0))
76
77 CALL check_intersection
78
80
81 IF (ALLOCATED(stripes)) &
82 CALL test_abort("unexpected non-zero amount of stripes for &
83 &empty index set", &
84 filename, __line__)
85
86 CALL check_bounding_box
87
90
92 CALL finish_mpi
93
94 IF (test_err_count() /= 0) CALL test_abort("non-zero error count", &
95 filename, __line__)
96
97CONTAINS
98
99 SUBROUTINE check_intersection
100 TYPE(xt_idxlist) :: intersection
101
103 CALL check_idxlist(intersection, no_idx(1:0))
105
106 END SUBROUTINE check_intersection
107
108 SUBROUTINE check_bounding_box
109 INTEGER, PARAMETER :: ndims = 3
110 INTEGER(xt_int_kind), PARAMETER :: global_start_index = 0
111 INTEGER(xt_int_kind) :: global_size(ndims)
112 TYPE(xt_bounds) :: bounds(ndims)
113
114 global_size = 10
116 global_start_index)
117 IF (any(bounds%size /= 0)) &
118 CALL test_abort("ERROR: non-zero boundings box for xt_idxempty in &
119 &xt_idxlist_get_bounding_box", &
120 filename, __line__)
121 END SUBROUTINE check_bounding_box
122
123END PROGRAM test_idxempty
124
125
126
127
128
129
130
131
132
void xt_initialize(MPI_Comm default_comm)
Xt_idxlist xt_idxempty_new(void)
void xt_idxlist_get_index_stripes(Xt_idxlist idxlist, struct Xt_stripe **stripes, int *num_stripes)
void xt_idxlist_get_bounding_box(Xt_idxlist idxlist, unsigned ndim, const Xt_int global_size[ndim], Xt_int global_start_index, struct Xt_bounds bounds[ndim])
Xt_idxlist xt_idxlist_get_intersection(Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst)
void xt_idxlist_delete(Xt_idxlist idxlist)