Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example fix. #276

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading