Skip to content

Commit 4cf99ed

Browse files
Example fix. (#276)
Fixes #274 Signed-off-by: Guillaume Mercier <[email protected]>
1 parent 668c122 commit 4cf99ed

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

tests/test-pthread-split.c

+3-10
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,15 @@ main(void)
100100
int npieces = 2; //ncores / 2;
101101
int nthreads = ncores;
102102

103+
103104
fprintf(stdout,"[%d] ====== Testing thread_scope_split (number of threads : %i)\n", tid, nthreads);
104105

105106
int colors[nthreads];
106107
for (int i = 0 ; i < nthreads ; i++) {
107108
colors[i] = i % npieces;
108109
}
109110

111+
110112
qv_scope_t **th_scopes = NULL;
111113
rc = qv_pthread_scope_split(
112114
mpi_scope, npieces, colors, nthreads, &th_scopes
@@ -124,6 +126,7 @@ main(void)
124126

125127
pthread_t thid[nthreads];
126128
pthread_attr_t *attr = NULL;
129+
127130
for (int i = 0 ; i < nthreads; ++i) {
128131
const int ptrc = qv_pthread_create(
129132
&thid[i], attr, thread_work, &thargs[i], th_scopes[i]
@@ -150,16 +153,6 @@ main(void)
150153
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
151154
}
152155

153-
154-
rc = qv_scope_free(mpi_scope);
155-
if (rc != QV_SUCCESS) {
156-
ers = "qv_scope_free() failed";
157-
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
158-
}
159-
160-
//MPI_Finalize();
161-
//exit(EXIT_SUCCESS);
162-
163156
//Test qv_pthread_scope_split_at
164157
nthreads = 2 * ncores;
165158

0 commit comments

Comments
 (0)