From dfc9d26f95f054303762477df8f111c2a7f462ab Mon Sep 17 00:00:00 2001 From: Guillaume Mercier Date: Wed, 11 Sep 2024 14:49:46 +0200 Subject: [PATCH] Example fix. Fixes https://github.com/hpc/quo-vadis/issues/274 Signed-off-by: Guillaume Mercier --- tests/test-pthread-split.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/test-pthread-split.c b/tests/test-pthread-split.c index 58b971b..0625ab4 100644 --- a/tests/test-pthread-split.c +++ b/tests/test-pthread-split.c @@ -100,6 +100,7 @@ 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]; @@ -107,6 +108,7 @@ main(void) colors[i] = i % npieces; } + qv_scope_t **th_scopes = NULL; rc = qv_pthread_scope_split( mpi_scope, npieces, colors, nthreads, &th_scopes @@ -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] @@ -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;