Skip to content

Commit

Permalink
Example fix.
Browse files Browse the repository at this point in the history
Fixes #274

Signed-off-by: Guillaume Mercier <[email protected]>
  • Loading branch information
GuillaumeMercier committed Sep 11, 2024
1 parent 668c122 commit dfc9d26
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions tests/test-pthread-split.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@ main(void)
int npieces = 2; //ncores / 2;
int nthreads = ncores;


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

int colors[nthreads];
for (int i = 0 ; i < nthreads ; i++) {
colors[i] = i % npieces;
}


qv_scope_t **th_scopes = NULL;
rc = qv_pthread_scope_split(
mpi_scope, npieces, colors, nthreads, &th_scopes
Expand All @@ -124,6 +126,7 @@ main(void)

pthread_t thid[nthreads];
pthread_attr_t *attr = NULL;

for (int i = 0 ; i < nthreads; ++i) {
const int ptrc = qv_pthread_create(
&thid[i], attr, thread_work, &thargs[i], th_scopes[i]
Expand All @@ -150,16 +153,6 @@ main(void)
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
}


rc = qv_scope_free(mpi_scope);
if (rc != QV_SUCCESS) {
ers = "qv_scope_free() failed";
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
}

//MPI_Finalize();
//exit(EXIT_SUCCESS);

//Test qv_pthread_scope_split_at
nthreads = 2 * ncores;

Expand Down

0 comments on commit dfc9d26

Please sign in to comment.