From 7465406d15bab65f9bdea833ce1983b2ba21ccf8 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Thu, 29 Apr 2010 15:44:52 +0000 Subject: [PATCH] psblas3: fixed fake mpi for --enable-serial. --- base/modules/psi_comm_buffers_mod.F90 | 22 ++++++++++++++++++++++ base/modules/psi_penv_mod.F90 | 8 +++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/base/modules/psi_comm_buffers_mod.F90 b/base/modules/psi_comm_buffers_mod.F90 index 87fdf949..7bec69d6 100644 --- a/base/modules/psi_comm_buffers_mod.F90 +++ b/base/modules/psi_comm_buffers_mod.F90 @@ -1,3 +1,25 @@ +#if defined(SERIAL_MPI) +! Provide a fake mpi module just to keep the compiler(s) happy. +module mpi + use psb_const_mod + integer, parameter :: mpi_success=0 + integer, parameter :: mpi_request_null=0 + integer, parameter :: mpi_status_size=1 + integer, parameter :: mpi_integer = 1 + integer, parameter :: mpi_integer8 = 2 + integer, parameter :: mpi_real = 3 + integer, parameter :: mpi_double_precision = 4 + integer, parameter :: mpi_complex = 5 + integer, parameter :: mpi_double_complex = 6 + integer, parameter :: mpi_character = 7 + integer, parameter :: mpi_logical = 8 + integer, parameter :: mpi_comm_null = -1 + integer, parameter :: mpi_comm_world = 1 + + real(psb_dpk_), external :: mpi_wtime +end module mpi +#endif + module psi_comm_buffers_mod use psb_const_mod diff --git a/base/modules/psi_penv_mod.F90 b/base/modules/psi_penv_mod.F90 index c8810017..c0e2ce50 100644 --- a/base/modules/psi_penv_mod.F90 +++ b/base/modules/psi_penv_mod.F90 @@ -92,6 +92,8 @@ contains psb_mpi_integer = mpi_integer #endif +#if defined(SERIAL_MPI) +#else if (info == 0) call mpi_op_create(psi_iamx_op,.true.,mpi_iamx_op,info) if (info == 0) call mpi_op_create(psi_iamn_op,.true.,mpi_iamn_op,info) if (info == 0) call mpi_op_create(psi_i8amx_op,.true.,mpi_i8amx_op,info) @@ -106,7 +108,7 @@ contains if (info == 0) call mpi_op_create(psi_zamn_op,.true.,mpi_zamn_op,info) if (info == 0) call mpi_op_create(psi_snrm2_op,.true.,mpi_snrm2_op,info) if (info == 0) call mpi_op_create(psi_dnrm2_op,.true.,mpi_dnrm2_op,info) - +#endif end subroutine psi_register_mpi_extras @@ -327,11 +329,11 @@ contains if (present(errc)) then code = errc else - core = -1 + code = -1 endif #if defined(SERIAL_MPI) - stop code + stop #else call mpi_abort(ictxt,code,info) #endif