diff --git a/include/quo-vadis-pthread.h b/include/quo-vadis-pthread.h index ceab5c2..360ba17 100644 --- a/include/quo-vadis-pthread.h +++ b/include/quo-vadis-pthread.h @@ -31,10 +31,10 @@ typedef struct { qv_scope_t *scope; void *(*thread_routine)(void *); void *arg; -} qv_thread_args_t; +} qv_pthread_args_t; void * -qv_thread_routine( +qv_pthread_routine( void *arg ); @@ -48,7 +48,7 @@ qv_pthread_create( ); int -qv_thread_scope_split_at( +qv_pthread_scope_split_at( qv_scope_t *scope, qv_hw_obj_type_t type, int *color_array, @@ -57,7 +57,7 @@ qv_thread_scope_split_at( ); int -qv_thread_scope_split( +qv_pthread_scope_split( qv_scope_t *scope, int npieces, int *color_array, diff --git a/src/quo-vadis-pthread.cc b/src/quo-vadis-pthread.cc index a866c46..ec032a0 100644 --- a/src/quo-vadis-pthread.cc +++ b/src/quo-vadis-pthread.cc @@ -23,7 +23,7 @@ #include "qvi-utils.h" int -qv_thread_scope_split( +qv_pthread_scope_split( qv_scope_t *scope, int npieces, int *color_array, @@ -36,7 +36,7 @@ qv_thread_scope_split( } int -qv_thread_scope_split_at( +qv_pthread_scope_split_at( qv_scope_t *scope, qv_hw_obj_type_t type, int *color_array, @@ -49,10 +49,10 @@ qv_thread_scope_split_at( } void * -qv_thread_routine( +qv_pthread_routine( void *arg ) { - qv_thread_args_t *arg_ptr = (qv_thread_args_t *)arg; + qv_pthread_args_t *arg_ptr = (qv_pthread_args_t *)arg; qvi_scope_bind_push(arg_ptr->scope); void *ret = arg_ptr->thread_routine(arg_ptr->arg); @@ -71,8 +71,8 @@ qv_pthread_create( void *arg, qv_scope_t *scope ) { - // Memory will be freed in qv_thread_routine to avoid memory leaks. - qv_thread_args_t *arg_ptr = nullptr; + // Memory will be freed in qv_pthread_routine to avoid memory leaks. + qv_pthread_args_t *arg_ptr = nullptr; int rc = qvi_new(&arg_ptr); if (rc != QV_SUCCESS) return rc; @@ -80,7 +80,7 @@ qv_pthread_create( arg_ptr->thread_routine = thread_routine; arg_ptr->arg = arg; - return pthread_create(thread, attr, qv_thread_routine, arg_ptr); + return pthread_create(thread, attr, qv_pthread_routine, arg_ptr); } /* diff --git a/tests/test-pthread-split.c b/tests/test-pthread-split.c index bab6374..ba03a08 100644 --- a/tests/test-pthread-split.c +++ b/tests/test-pthread-split.c @@ -70,7 +70,7 @@ main(void) qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc)); } - //test qv_thread_scope_split + //test qv_pthread_scope_split int npieces = n_cores / 2; int nthreads = n_cores; @@ -81,9 +81,9 @@ main(void) colors[i] = i % npieces; qv_scope_t **th_scopes = NULL; - rc = qv_thread_scope_split(mpi_scope, npieces , colors , nthreads, &th_scopes); + rc = qv_pthread_scope_split(mpi_scope, npieces , colors , nthreads, &th_scopes); if (rc != QV_SUCCESS) { - ers = "qv_thread_scope_split() failed"; + ers = "qv_pthread_scope_split() failed"; qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc)); } @@ -119,7 +119,7 @@ main(void) // API. //free(th_scopes); - //Test qv_thread_scope_split_at + //Test qv_pthread_scope_split_at nthreads = 2*n_cores; fprintf(stdout,"[%d] ====== Testing thread_scope_split_at (number of threads : %i)\n", wrank, nthreads); @@ -128,9 +128,9 @@ main(void) for(int i = 0 ; i < nthreads ; i++) colors2[i] = i%n_cores; - rc = qv_thread_scope_split_at(mpi_scope, QV_HW_OBJ_CORE, colors2, nthreads, &th_scopes); + rc = qv_pthread_scope_split_at(mpi_scope, QV_HW_OBJ_CORE, colors2, nthreads, &th_scopes); if (rc != QV_SUCCESS) { - ers = "qv_thread_scope_split_at() failed"; + ers = "qv_pthread_scope_split_at() failed"; qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc)); }