Skip to content

Commit 9ab1a48

Browse files
author
Alessandro Fanfarillo
committed
Removed warnings during compilation and fixed co_reduce test
Signed-off-by: Alessandro Fanfarillo <[email protected]>
1 parent cf30bc5 commit 9ab1a48

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/mpi/mpi_caf.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,25 +2041,25 @@ PREFIX (co_reduce) (gfc_descriptor_t *a, void *(*opr) (void *, void *), int opr_
20412041
MPI_Op op;
20422042
if(GFC_DESCRIPTOR_TYPE(a) == BT_INTEGER)
20432043
{
2044-
foo_int32_t = opr;
2044+
foo_int32_t = (typeof(foo_int32_t))opr;
20452045
MPI_Op_create(redux_int32, 1, &op);
20462046
}
20472047
else if(GFC_DESCRIPTOR_TYPE(a) == BT_REAL)
20482048
{
20492049
if(GFC_DESCRIPTOR_SIZE(a) == sizeof(float))
20502050
{
2051-
foo_float = opr;
2051+
foo_float = (typeof(foo_float))opr;
20522052
MPI_Op_create(redux_real32, 1, &op);
20532053
}
20542054
else
20552055
{
2056-
foo_double = opr;
2056+
foo_double = (typeof(foo_double))opr;
20572057
MPI_Op_create(redux_real64, 1, &op);
20582058
}
20592059
}
20602060
else if(GFC_DESCRIPTOR_TYPE(a) == BT_LOGICAL)
20612061
{
2062-
foo_int32_t = opr;
2062+
foo_int32_t = (typeof(foo_int32_t))opr;
20632063
MPI_Op_create(redux_int32, 1, &op);
20642064
}
20652065
else

src/tests/unit/collectives/co_reduce.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module co_intrinsics_module
4646
contains
4747

4848
subroutine co_all_logical(a)
49-
logical, intent(inout) :: a
49+
logical, intent(inout) :: a(:)
5050
call co_reduce(a,and)
5151
contains
5252
pure function and(lhs,rhs) result(lhs_and_rhs) bind(C,name="and")
@@ -98,10 +98,10 @@ program main
9898

9999
! Verify that every image has a "true" variable with the value .true.
100100
verify_co_reduce_logical: block
101-
logical :: true=.true.
101+
logical,dimension(10) :: true=.true.
102102
sync all
103103
call co_all(true)
104-
if (true) then
104+
if (all(true .eqv. .true.)) then
105105
logical_passes=.true.
106106
else
107107
write(error_unit,"(2(a,i2))") "co_reduce fails for logical argument with result (",true,") on image",this_image()

0 commit comments

Comments
 (0)