Skip to content

Commit 5c4f257

Browse files
Rename qv_scope_ntasks() to qv_scope_group_size(). (#262)
Signed-off-by: Samuel K. Gutierrez <[email protected]>
1 parent 2d57d3d commit 5c4f257

11 files changed

+38
-38
lines changed

include/quo-vadis.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ qv_scope_group_rank(
186186
*
187187
*/
188188
int
189-
qv_scope_ntasks(
189+
qv_scope_group_size(
190190
qv_scope_t *scope,
191191
int *ntasks
192192
);

src/fortran/quo-vadisf.f90

+6-6
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,13 @@ function qv_scope_group_rank_c(scope, taskid) &
197197
end function qv_scope_group_rank_c
198198

199199
integer(c_int) &
200-
function qv_scope_ntasks_c(scope, ntasks) &
201-
bind(c, name='qv_scope_ntasks')
200+
function qv_scope_group_size_c(scope, ntasks) &
201+
bind(c, name='qv_scope_group_size')
202202
use, intrinsic :: iso_c_binding, only: c_ptr, c_int
203203
implicit none
204204
type(c_ptr), value :: scope
205205
integer(c_int), intent(out) :: ntasks
206-
end function qv_scope_ntasks_c
206+
end function qv_scope_group_size_c
207207

208208
integer(c_int) &
209209
function qv_scope_barrier_c(scope) &
@@ -350,14 +350,14 @@ subroutine qv_scope_group_rank(scope, taskid, info)
350350
info = qv_scope_group_rank_c(scope, taskid)
351351
end subroutine qv_scope_group_rank
352352

353-
subroutine qv_scope_ntasks(scope, ntasks, info)
353+
subroutine qv_scope_group_size(scope, ntasks, info)
354354
use, intrinsic :: iso_c_binding, only: c_ptr, c_int
355355
implicit none
356356
type(c_ptr), value :: scope
357357
integer(c_int), intent(out) :: ntasks
358358
integer(c_int), intent(out) :: info
359-
info = qv_scope_ntasks_c(scope, ntasks)
360-
end subroutine qv_scope_ntasks
359+
info = qv_scope_group_size_c(scope, ntasks)
360+
end subroutine qv_scope_group_size
361361

362362
subroutine qv_scope_barrier(scope, info)
363363
use, intrinsic :: iso_c_binding, only: c_ptr, c_int

src/quo-vadis.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ qv_scope_group_rank(
121121

122122
// TODO(skg) Rename to qv_scope_group_size.
123123
int
124-
qv_scope_ntasks(
124+
qv_scope_group_size(
125125
qv_scope_t *scope,
126126
int *ntasks
127127
) {

tests/qvi-test-common.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,18 @@ qvi_test_scope_report(
8282
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
8383
}
8484

85-
int ntasks;
86-
rc = qv_scope_ntasks(scope, &ntasks);
85+
int sgsize;
86+
rc = qv_scope_group_size(scope, &sgsize);
8787
if (rc != QV_SUCCESS) {
88-
ers = "qv_scope_ntasks() failed";
88+
ers = "qv_scope_group_size() failed";
8989
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
9090
}
9191

9292
printf(
9393
"[%d] %s sgrank is %d\n"
94-
"[%d] %s ntasks is %d\n",
94+
"[%d] %s sgsize is %d\n",
9595
pid, scope_name, sgrank,
96-
pid, scope_name, ntasks
96+
pid, scope_name, sgsize
9797
);
9898

9999
rc = qv_scope_barrier(scope);

tests/test-mpi-fortapi.f90

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ program mpi_fortapi
1919

2020

2121
integer(c_int) info, n
22-
integer(c_int) ntasks, sgrank, n_cores, n_gpu
22+
integer(c_int) sgsize, sgrank, n_cores, n_gpu
2323
integer(c_int) vmajor, vminor, vpatch
2424
integer cwrank, cwsize, scope_comm, scope_comm_size
2525
type(c_ptr) scope_user, sub_scope
@@ -76,11 +76,11 @@ program mpi_fortapi
7676
error stop
7777
end if
7878

79-
call qv_scope_ntasks(scope_user, ntasks, info)
79+
call qv_scope_group_size(scope_user, sgsize, info)
8080
if (info .ne. QV_SUCCESS) then
8181
error stop
8282
end if
83-
print *, 'ntasks', ntasks
83+
print *, 'sgsize', sgsize
8484

8585
call qv_scope_group_rank(scope_user, sgrank, info)
8686
if (info .ne. QV_SUCCESS) then

tests/test-mpi-scopes-affinity-preserving.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ main(
6161

6262
qvi_test_scope_report(base_scope, "base_scope");
6363

64-
int base_scope_ntasks;
65-
rc = qv_scope_ntasks(
64+
int base_scope_sgsize;
65+
rc = qv_scope_group_size(
6666
base_scope,
67-
&base_scope_ntasks
67+
&base_scope_sgsize
6868
);
6969
if (rc != QV_SUCCESS) {
70-
ers = "qv_scope_ntasks() failed";
70+
ers = "qv_scope_group_size() failed";
7171
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
7272
}
7373

tests/test-mpi-scopes.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ main(
9090
}
9191
qvi_test_scope_report(base_scope, "base_scope");
9292

93-
int base_scope_ntasks;
94-
rc = qv_scope_ntasks(
93+
int base_scope_sgsize;
94+
rc = qv_scope_group_size(
9595
base_scope,
96-
&base_scope_ntasks
96+
&base_scope_sgsize
9797
);
9898
if (rc != QV_SUCCESS) {
99-
ers = "qv_scope_ntasks() failed";
99+
ers = "qv_scope_group_size() failed";
100100
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
101101
}
102102

@@ -125,7 +125,7 @@ main(
125125
const int npieces = 2;
126126
const int gid = get_group_id(
127127
base_scope_rank,
128-
base_scope_ntasks,
128+
base_scope_sgsize,
129129
npieces
130130
);
131131
printf("[%d] base GID is %d\n", wrank, gid);

tests/test-mpi-threads.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ scope_report(
4848
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
4949
}
5050

51-
int ntasks;
52-
rc = qv_scope_ntasks(scope, &ntasks);
51+
int sgsize;
52+
rc = qv_scope_group_size(scope, &sgsize);
5353
if (rc != QV_SUCCESS) {
54-
ers = "qv_scope_ntasks() failed";
54+
ers = "qv_scope_group_size() failed";
5555
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
5656
}
5757

5858
printf("[%d] %s taskid is %d\n", pid, scope_name, taskid);
59-
printf("[%d] %s ntasks is %d\n", pid, scope_name, ntasks);
59+
printf("[%d] %s sgsize is %d\n", pid, scope_name, sgsize);
6060

6161
rc = qv_scope_barrier(scope);
6262
if (rc != QV_SUCCESS) {

tests/test-omp.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ scopei_fill(
4242
) {
4343
char *ers = NULL;
4444

45-
int rc = qv_scope_ntasks(sinfo->scope, &sinfo->size);
45+
int rc = qv_scope_group_size(sinfo->scope, &sinfo->size);
4646
if (rc != QV_SUCCESS) {
47-
ers = "qv_scope_ntasks() failed";
47+
ers = "qv_scope_group_size() failed";
4848
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
4949
}
5050

tests/test-process-fortapi.f90

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ program process_fortapi
1818

1919

2020
integer(c_int) info, n
21-
integer(c_int) ntasks, sgrank, n_cores, n_gpu
21+
integer(c_int) sgsize, sgrank, n_cores, n_gpu
2222
type(c_ptr) scope_user
2323
character(len=:),allocatable :: bstr(:)
2424
character(len=:),allocatable :: dev_pci(:)
@@ -29,11 +29,11 @@ program process_fortapi
2929
error stop
3030
end if
3131

32-
call qv_scope_ntasks(scope_user, ntasks, info)
32+
call qv_scope_group_size(scope_user, sgsize, info)
3333
if (info .ne. QV_SUCCESS) then
3434
error stop
3535
end if
36-
print *, 'ntasks', ntasks
36+
print *, 'sgsize', sgsize
3737

3838
call qv_scope_group_rank(scope_user, sgrank, info)
3939
if (info .ne. QV_SUCCESS) then

tests/test-process-scopes.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ main(void)
6464
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
6565
}
6666

67-
int ntasks;
68-
rc = qv_scope_ntasks(base_scope, &ntasks);
67+
int sgsize;
68+
rc = qv_scope_group_size(base_scope, &sgsize);
6969
if (rc != QV_SUCCESS) {
70-
ers = "qv_scope_ntasks() failed";
70+
ers = "qv_scope_group_size() failed";
7171
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
7272
}
73-
if (ntasks != 1) {
73+
if (sgsize != 1) {
7474
ers = "Invalid number of tasks detected";
7575
qvi_test_panic("%s (rc=%s)", ers, qv_strerr(rc));
7676
}

0 commit comments

Comments
 (0)