Skip to content

Commit e4fe97b

Browse files
committed
Ensure gcc-16 compatibility.
Fix is_present for descriptor arrays in gcc-16. Remove compiling warning from test_case.
1 parent 5661643 commit e4fe97b

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/runtime-libraries/mpi/mpi_caf.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6095,19 +6095,19 @@ PREFIX(is_present_on_remote)(caf_token_t token, const int image_index,
60956095

60966096
if (this_image == remote_image)
60976097
{
6098+
mpi_caf_token_t *mpi_token = (mpi_caf_token_t *)token;
60986099
int32_t result = 0;
60996100
mpi_caf_token_t src_token = {get_data, MPI_WIN_NULL, NULL};
6100-
void *src_ptr = ((mpi_caf_token_t *)token)->memptr;
6101-
6102-
dprint("Shortcutting due to self access on image %d.\n", image_index);
6103-
accessor_hash_table[is_present_index].u.is_present(add_data, &this_image,
6104-
&result,
61056101
#ifdef GCC_GE_16
6106-
&src_ptr,
6102+
void *src_ptr
6103+
= mpi_token->desc ? mpi_token->desc : (void *)&mpi_token->memptr;
61076104
#else
6108-
src_ptr,
6105+
void *src_ptr = mpi_token->memptr;
61096106
#endif
6110-
&src_token, 0);
6107+
6108+
dprint("Shortcutting due to self access on image %d.\n", image_index);
6109+
accessor_hash_table[is_present_index].u.is_present(
6110+
add_data, &this_image, &result, src_ptr, &src_token, 0);
61116111

61126112
return result;
61136113
}

src/tests/unit/collectives/co_reduce_string.f90

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ program co_reduce_strings
4040
associate (me => this_image())
4141
allocate(strarr(numstrings)[*])
4242
do i = 1, numstrings
43-
write(strarr(i), "('foo'I02)") i * me
43+
write(strarr(i), "('foo',I02)") i * me
4444
end do
4545
! Collectively reduce the maximum string.
4646
call co_reduce(strarr, strmax)
@@ -50,7 +50,7 @@ program co_reduce_strings
5050
! implicitly synchronizes.
5151
associate (np => num_images())
5252
do i = 1, np
53-
write (expect, "('foo'I02)") i * np
53+
write (expect, "('foo',I02)") i * np
5454
if (strarr(i) /= expect) then
5555
! On errror print what we got and what we expected.
5656
print *, "Got: ", strarr(i), ", expected: ", expect
@@ -77,4 +77,3 @@ pure function strmax(lhs, rhs) result(maxstr) bind(C,name="strmax")
7777
end function
7878

7979
end program co_reduce_strings
80-

0 commit comments

Comments
 (0)