Skip to content

Commit

Permalink
Rename qv_scope_ntasks() to qv_scope_group_size().
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel K. Gutierrez <[email protected]>
  • Loading branch information
samuelkgutierrez committed Jul 28, 2024
1 parent 2d57d3d commit ca78815
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion include/quo-vadis.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ qv_scope_group_rank(
*
*/
int
qv_scope_ntasks(
qv_scope_group_size(
qv_scope_t *scope,
int *ntasks
);
Expand Down
12 changes: 6 additions & 6 deletions src/fortran/quo-vadisf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,13 @@ function qv_scope_group_rank_c(scope, taskid) &
end function qv_scope_group_rank_c

integer(c_int) &
function qv_scope_ntasks_c(scope, ntasks) &
bind(c, name='qv_scope_ntasks')
function qv_scope_group_size_c(scope, ntasks) &
bind(c, name='qv_scope_group_size')
use, intrinsic :: iso_c_binding, only: c_ptr, c_int
implicit none
type(c_ptr), value :: scope
integer(c_int), intent(out) :: ntasks
end function qv_scope_ntasks_c
end function qv_scope_group_size_c

integer(c_int) &
function qv_scope_barrier_c(scope) &
Expand Down Expand Up @@ -350,14 +350,14 @@ subroutine qv_scope_group_rank(scope, taskid, info)
info = qv_scope_group_rank_c(scope, taskid)
end subroutine qv_scope_group_rank

subroutine qv_scope_ntasks(scope, ntasks, info)
subroutine qv_scope_group_size(scope, ntasks, info)
use, intrinsic :: iso_c_binding, only: c_ptr, c_int
implicit none
type(c_ptr), value :: scope
integer(c_int), intent(out) :: ntasks
integer(c_int), intent(out) :: info
info = qv_scope_ntasks_c(scope, ntasks)
end subroutine qv_scope_ntasks
info = qv_scope_group_size_c(scope, ntasks)
end subroutine qv_scope_group_size

subroutine qv_scope_barrier(scope, info)
use, intrinsic :: iso_c_binding, only: c_ptr, c_int
Expand Down
2 changes: 1 addition & 1 deletion src/quo-vadis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ qv_scope_group_rank(

// TODO(skg) Rename to qv_scope_group_size.
int
qv_scope_ntasks(
qv_scope_group_size(
qv_scope_t *scope,
int *ntasks
) {
Expand Down
10 changes: 5 additions & 5 deletions tests/qvi-test-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,18 @@ qvi_test_scope_report(
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
}

int ntasks;
rc = qv_scope_ntasks(scope, &ntasks);
int sgsize;
rc = qv_scope_group_size(scope, &sgsize);
if (rc != QV_SUCCESS) {
ers = "qv_scope_ntasks() failed";
ers = "qv_scope_group_size() failed";
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
}

printf(
"[%d] %s sgrank is %d\n"
"[%d] %s ntasks is %d\n",
"[%d] %s sgsize is %d\n",
pid, scope_name, sgrank,
pid, scope_name, ntasks
pid, scope_name, sgsize
);

rc = qv_scope_barrier(scope);
Expand Down
6 changes: 3 additions & 3 deletions tests/test-mpi-fortapi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ program mpi_fortapi


integer(c_int) info, n
integer(c_int) ntasks, sgrank, n_cores, n_gpu
integer(c_int) sgsize, sgrank, n_cores, n_gpu
integer(c_int) vmajor, vminor, vpatch
integer cwrank, cwsize, scope_comm, scope_comm_size
type(c_ptr) scope_user, sub_scope
Expand Down Expand Up @@ -76,11 +76,11 @@ program mpi_fortapi
error stop
end if

call qv_scope_ntasks(scope_user, ntasks, info)
call qv_scope_group_size(scope_user, sgsize, info)
if (info .ne. QV_SUCCESS) then
error stop
end if
print *, 'ntasks', ntasks
print *, 'sgsize', sgsize

call qv_scope_group_rank(scope_user, sgrank, info)
if (info .ne. QV_SUCCESS) then
Expand Down
8 changes: 4 additions & 4 deletions tests/test-mpi-scopes-affinity-preserving.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ main(

qvi_test_scope_report(base_scope, "base_scope");

int base_scope_ntasks;
rc = qv_scope_ntasks(
int base_scope_sgsize;
rc = qv_scope_group_size(
base_scope,
&base_scope_ntasks
&base_scope_sgsize
);
if (rc != QV_SUCCESS) {
ers = "qv_scope_ntasks() failed";
ers = "qv_scope_group_size() failed";
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
}

Expand Down
10 changes: 5 additions & 5 deletions tests/test-mpi-scopes.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ main(
}
qvi_test_scope_report(base_scope, "base_scope");

int base_scope_ntasks;
rc = qv_scope_ntasks(
int base_scope_sgsize;
rc = qv_scope_group_size(
base_scope,
&base_scope_ntasks
&base_scope_sgsize
);
if (rc != QV_SUCCESS) {
ers = "qv_scope_ntasks() failed";
ers = "qv_scope_group_size() failed";
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
}

Expand Down Expand Up @@ -125,7 +125,7 @@ main(
const int npieces = 2;
const int gid = get_group_id(
base_scope_rank,
base_scope_ntasks,
base_scope_sgsize,
npieces
);
printf("[%d] base GID is %d\n", wrank, gid);
Expand Down
8 changes: 4 additions & 4 deletions tests/test-mpi-threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ scope_report(
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
}

int ntasks;
rc = qv_scope_ntasks(scope, &ntasks);
int sgsize;
rc = qv_scope_group_size(scope, &sgsize);
if (rc != QV_SUCCESS) {
ers = "qv_scope_ntasks() failed";
ers = "qv_scope_group_size() failed";
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
}

printf("[%d] %s taskid is %d\n", pid, scope_name, taskid);
printf("[%d] %s ntasks is %d\n", pid, scope_name, ntasks);
printf("[%d] %s sgsize is %d\n", pid, scope_name, sgsize);

rc = qv_scope_barrier(scope);
if (rc != QV_SUCCESS) {
Expand Down
4 changes: 2 additions & 2 deletions tests/test-omp.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ scopei_fill(
) {
char *ers = NULL;

int rc = qv_scope_ntasks(sinfo->scope, &sinfo->size);
int rc = qv_scope_group_size(sinfo->scope, &sinfo->size);
if (rc != QV_SUCCESS) {
ers = "qv_scope_ntasks() failed";
ers = "qv_scope_group_size() failed";
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
}

Expand Down
6 changes: 3 additions & 3 deletions tests/test-process-fortapi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ program process_fortapi


integer(c_int) info, n
integer(c_int) ntasks, sgrank, n_cores, n_gpu
integer(c_int) sgsize, sgrank, n_cores, n_gpu
type(c_ptr) scope_user
character(len=:),allocatable :: bstr(:)
character(len=:),allocatable :: dev_pci(:)
Expand All @@ -29,11 +29,11 @@ program process_fortapi
error stop
end if

call qv_scope_ntasks(scope_user, ntasks, info)
call qv_scope_group_size(scope_user, sgsize, info)
if (info .ne. QV_SUCCESS) then
error stop
end if
print *, 'ntasks', ntasks
print *, 'sgsize', sgsize

call qv_scope_group_rank(scope_user, sgrank, info)
if (info .ne. QV_SUCCESS) then
Expand Down
8 changes: 4 additions & 4 deletions tests/test-process-scopes.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ main(void)
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
}

int ntasks;
rc = qv_scope_ntasks(base_scope, &ntasks);
int sgsize;
rc = qv_scope_group_size(base_scope, &sgsize);
if (rc != QV_SUCCESS) {
ers = "qv_scope_ntasks() failed";
ers = "qv_scope_group_size() failed";
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
}
if (ntasks != 1) {
if (sgsize != 1) {
ers = "Invalid number of tasks detected";
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
}
Expand Down

0 comments on commit ca78815

Please sign in to comment.