@@ -33,22 +33,28 @@ thread_work(
33
33
fprintf (stdout ,"[%d] Thread running on %s\n" , tid , binds );
34
34
free (binds );
35
35
36
- qv_scope_t * out_scope = NULL ;
37
36
int rank = -1 ;
38
37
rc = qv_scope_group_rank (thargs -> scope , & rank );
39
38
if (rc != QV_SUCCESS ) {
40
39
ers = "qv_scope_group_rank failed" ;
41
40
qvi_test_panic ("%s (rc=%s)" , ers , qv_strerr (rc ));
42
41
}
43
42
44
- fprintf (stdout ,"=== [%d] Thread %i splitting in two pieces\n" , tid , rank );
43
+ fprintf (stdout ,"[%d] Thread %d splitting in two pieces\n" , tid , rank );
45
44
45
+ qv_scope_t * out_scope = NULL ;
46
46
rc = qv_scope_split (thargs -> scope , 2 , rank , & out_scope );
47
47
if (rc != QV_SUCCESS ) {
48
48
ers = "qv_scope_split failed" ;
49
49
qvi_test_panic ("%s (rc=%s)" , ers , qv_strerr (rc ));
50
50
}
51
51
52
+ rc = qv_scope_free (out_scope );
53
+ if (rc != QV_SUCCESS ) {
54
+ ers = "qv_scope_free failed" ;
55
+ qvi_test_panic ("%s (rc=%s)" , ers , qv_strerr (rc ));
56
+ }
57
+
52
58
return NULL ;
53
59
}
54
60
@@ -95,21 +101,15 @@ main(void)
95
101
ers = "qv_scope_nobjs() failed" ;
96
102
qvi_test_panic ("%s (rc=%s)" , ers , qv_strerr (rc ));
97
103
}
98
-
99
- //test qv_pthread_scope_split
100
- int npieces = 2 ; //ncores / 2;
104
+ //
105
+ // Test qv_pthread_scope_split
106
+ //
107
+ int npieces = 2 ;
101
108
int nthreads = ncores ;
102
109
103
-
104
- fprintf (stdout ,"[%d] ====== Testing thread_scope_split (number of threads : %i)\n" , tid , nthreads );
110
+ printf ("[%d] Testing thread_scope_split (nthreads=%i)\n" , tid , nthreads );
105
111
106
112
int colors [nthreads ];
107
-
108
- /*
109
- for (int i = 0 ; i < nthreads ; i++) {
110
- colors[i] = i % npieces;
111
- }
112
- */
113
113
rc = qv_pthread_colors_fill (colors , nthreads , QV_POLICY_PACKED , 1 , npieces );
114
114
if (rc != QV_SUCCESS ) {
115
115
ers = "qv_pthread_colors_fill() failed" ;
@@ -152,14 +152,13 @@ main(void)
152
152
}
153
153
//fprintf(stdout,"Thread finished with '%s'\n", (char *)ret);
154
154
}
155
-
156
- /* Clean up */
155
+ // Clean up.
157
156
rc = qv_pthread_scopes_free (nthreads , th_scopes );
158
157
if (rc != QV_SUCCESS ) {
159
158
ers = "qv_pthread_scope_free() failed" ;
160
159
qvi_test_panic ("%s (rc=%s)" , ers , qv_strerr (rc ));
161
160
}
162
-
161
+ #if 0
163
162
//Test qv_pthread_scope_split_at
164
163
nthreads = 2 * ncores ;
165
164
@@ -216,7 +215,7 @@ main(void)
216
215
ers = "qv_pthread_scope_free() failed" ;
217
216
qvi_test_panic ("%s (rc=%s)" , ers , qv_strerr (rc ));
218
217
}
219
-
218
+ #endif
220
219
rc = qv_scope_free (mpi_scope );
221
220
if (rc != QV_SUCCESS ) {
222
221
ers = "qv_scope_free() failed" ;
0 commit comments