Skip to content

Commit 613ea22

Browse files
arciyer123Krishnan Iyer
authored andcommitted
check single precision to see if working with MPI
1 parent 1b3274b commit 613ea22

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/common/m_mpi_common.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,10 +378,10 @@ contains
378378
379379
! Performing reduction procedure and eventually storing its result
380380
! into the variable that was initially inputted into the subroutine
381-
call MPI_REDUCE(var_loc, var_glb, 1, MPI_2DOUBLE_PRECISION, &
381+
call MPI_REDUCE(var_loc, var_glb, 1, MPI_2REAL, &
382382
MPI_MAXLOC, 0, MPI_COMM_WORLD, ierr)
383383
384-
call MPI_BCAST(var_glb, 1, MPI_2DOUBLE_PRECISION, &
384+
call MPI_BCAST(var_glb, 1, MPI_2REAL, &
385385
0, MPI_COMM_WORLD, ierr)
386386
387387
var_loc = var_glb

src/common/m_precision_select.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ module m_precision_select
1414
integer, parameter :: double_precision = selected_real_kind(15, 307)
1515

1616
! Set the working precision (wp) to single or double precision
17-
integer, parameter :: wp = double_precision ! Change to single_precision if needed
17+
integer, parameter :: wp = single_precision ! Change to single_precision if needed
1818

1919
#ifdef MFC_MPI
2020
! Set mpi_p based on wp using the merge intrinsic function
21-
integer, parameter :: mpi_p = merge(MPI_DOUBLE_PRECISION, MPI_FLOAT, wp == double_precision)
21+
integer, parameter :: mpi_p = merge(MPI_DOUBLE_PRECISION, MPI_REAL, wp == double_precision)
2222
#else
2323
integer, parameter :: mpi_p = -100 ! Default value when MPI is not used
2424
#endif

0 commit comments

Comments
 (0)