From ea6c4181f799b715a9919821e32cb6aa63e00609 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Fri, 14 Mar 2025 12:54:18 +0100 Subject: [PATCH 01/20] Changed all defines with prefix PSB_ --- Make.inc.in | 4 +- base/comm/internals/psi_cswapdata.F90 | 16 +- base/comm/internals/psi_cswapdata_a.F90 | 16 +- base/comm/internals/psi_cswaptran.F90 | 16 +- base/comm/internals/psi_cswaptran_a.F90 | 16 +- base/comm/internals/psi_dswapdata.F90 | 16 +- base/comm/internals/psi_dswapdata_a.F90 | 16 +- base/comm/internals/psi_dswaptran.F90 | 16 +- base/comm/internals/psi_dswaptran_a.F90 | 16 +- base/comm/internals/psi_eswapdata_a.F90 | 16 +- base/comm/internals/psi_eswaptran_a.F90 | 16 +- base/comm/internals/psi_i2swapdata_a.F90 | 16 +- base/comm/internals/psi_i2swaptran_a.F90 | 16 +- base/comm/internals/psi_iswapdata.F90 | 16 +- base/comm/internals/psi_iswaptran.F90 | 16 +- base/comm/internals/psi_lswapdata.F90 | 16 +- base/comm/internals/psi_lswaptran.F90 | 16 +- base/comm/internals/psi_mswapdata_a.F90 | 16 +- base/comm/internals/psi_mswaptran_a.F90 | 16 +- base/comm/internals/psi_sswapdata.F90 | 16 +- base/comm/internals/psi_sswapdata_a.F90 | 16 +- base/comm/internals/psi_sswaptran.F90 | 16 +- base/comm/internals/psi_sswaptran_a.F90 | 16 +- base/comm/internals/psi_zswapdata.F90 | 16 +- base/comm/internals/psi_zswapdata_a.F90 | 16 +- base/comm/internals/psi_zswaptran.F90 | 16 +- base/comm/internals/psi_zswaptran_a.F90 | 16 +- base/comm/psb_cscatter_a.F90 | 16 +- base/comm/psb_cspgather.F90 | 16 +- base/comm/psb_dscatter_a.F90 | 16 +- base/comm/psb_dspgather.F90 | 16 +- base/comm/psb_escatter_a.F90 | 16 +- base/comm/psb_i2scatter_a.F90 | 16 +- base/comm/psb_ispgather.F90 | 16 +- base/comm/psb_lspgather.F90 | 16 +- base/comm/psb_mscatter_a.F90 | 16 +- base/comm/psb_sscatter_a.F90 | 16 +- base/comm/psb_sspgather.F90 | 16 +- base/comm/psb_zscatter_a.F90 | 16 +- base/comm/psb_zspgather.F90 | 16 +- base/internals/psi_a2a_fnd_owner.F90 | 6 +- base/internals/psi_adjcncy_fnd_owner.F90 | 6 +- base/internals/psi_bld_glb_dep_list.F90 | 4 +- base/internals/psi_desc_index.F90 | 4 +- base/internals/psi_fnd_owner.F90 | 4 +- base/internals/psi_graph_fnd_owner.F90 | 8 +- base/internals/psi_indx_map_fnd_owner.F90 | 4 +- base/internals/psi_symm_dep_list.F90 | 8 +- base/internals/psi_xtr_loc_dl.F90 | 4 +- base/modules/auxil/psb_c_realloc_mod.F90 | 219 +++++++++++--------- base/modules/auxil/psb_d_realloc_mod.F90 | 219 +++++++++++--------- base/modules/auxil/psb_e_realloc_mod.F90 | 219 +++++++++++--------- base/modules/auxil/psb_i2_realloc_mod.F90 | 219 +++++++++++--------- base/modules/auxil/psb_m_realloc_mod.F90 | 219 +++++++++++--------- base/modules/auxil/psb_s_realloc_mod.F90 | 219 +++++++++++--------- base/modules/auxil/psb_z_realloc_mod.F90 | 219 +++++++++++--------- base/modules/desc/psb_desc_mod.F90 | 2 +- base/modules/desc/psb_gen_block_map_mod.F90 | 6 +- base/modules/desc/psb_hash_map_mod.F90 | 85 ++++---- base/modules/desc/psb_hash_mod.F90 | 8 +- base/modules/desc/psb_indx_map_mod.F90 | 4 +- base/modules/desc/psb_list_map_mod.F90 | 16 +- base/modules/penv/psi_c_collective_mod.F90 | 122 +++++------ base/modules/penv/psi_c_p2p_mod.F90 | 36 ++-- base/modules/penv/psi_collective_mod.F90 | 48 ++--- base/modules/penv/psi_d_collective_mod.F90 | 170 +++++++-------- base/modules/penv/psi_d_p2p_mod.F90 | 36 ++-- base/modules/penv/psi_e_collective_mod.F90 | 158 +++++++------- base/modules/penv/psi_e_p2p_mod.F90 | 36 ++-- base/modules/penv/psi_i2_collective_mod.F90 | 158 +++++++------- base/modules/penv/psi_i2_p2p_mod.F90 | 36 ++-- base/modules/penv/psi_m_collective_mod.F90 | 158 +++++++------- base/modules/penv/psi_m_p2p_mod.F90 | 36 ++-- base/modules/penv/psi_p2p_mod.F90 | 48 ++--- base/modules/penv/psi_penv_mod.F90 | 107 +++++----- base/modules/penv/psi_s_collective_mod.F90 | 170 +++++++-------- base/modules/penv/psi_s_p2p_mod.F90 | 36 ++-- base/modules/penv/psi_z_collective_mod.F90 | 122 +++++------ base/modules/penv/psi_z_p2p_mod.F90 | 36 ++-- base/modules/psb_cbind_const_mod.F90 | 6 +- base/modules/psb_config.h.in | 12 +- base/modules/psb_const_mod.F90 | 22 +- base/modules/psb_error_impl.F90 | 8 +- base/modules/psb_error_mod.F90 | 2 +- base/modules/psblas/psb_c_psblas_mod.F90 | 10 +- base/modules/psblas/psb_d_psblas_mod.F90 | 10 +- base/modules/psblas/psb_s_psblas_mod.F90 | 10 +- base/modules/psblas/psb_z_psblas_mod.F90 | 10 +- base/modules/serial/psb_base_mat_mod.F90 | 10 +- base/modules/serial/psb_c_base_mat_mod.F90 | 8 +- base/modules/serial/psb_c_base_vect_mod.F90 | 16 +- base/modules/serial/psb_c_mat_mod.F90 | 16 +- base/modules/serial/psb_d_base_mat_mod.F90 | 8 +- base/modules/serial/psb_d_base_vect_mod.F90 | 18 +- base/modules/serial/psb_d_mat_mod.F90 | 16 +- base/modules/serial/psb_i_base_vect_mod.F90 | 6 +- base/modules/serial/psb_l_base_vect_mod.F90 | 6 +- base/modules/serial/psb_s_base_mat_mod.F90 | 8 +- base/modules/serial/psb_s_base_vect_mod.F90 | 18 +- base/modules/serial/psb_s_mat_mod.F90 | 16 +- base/modules/serial/psb_z_base_mat_mod.F90 | 8 +- base/modules/serial/psb_z_base_vect_mod.F90 | 16 +- base/modules/serial/psb_z_mat_mod.F90 | 16 +- base/modules/tools/psb_c_tools_mod.F90 | 2 +- base/modules/tools/psb_cd_tools_mod.F90 | 2 +- base/modules/tools/psb_d_tools_mod.F90 | 2 +- base/modules/tools/psb_s_tools_mod.F90 | 2 +- base/modules/tools/psb_z_tools_mod.F90 | 2 +- base/psblas/psb_cgetmatinfo.F90 | 4 +- base/psblas/psb_cspmm.f90 | 2 +- base/psblas/psb_cspsm.f90 | 2 +- base/psblas/psb_dgetmatinfo.F90 | 4 +- base/psblas/psb_dspmm.f90 | 2 +- base/psblas/psb_dspsm.f90 | 2 +- base/psblas/psb_sgetmatinfo.F90 | 4 +- base/psblas/psb_sspmm.f90 | 2 +- base/psblas/psb_sspsm.f90 | 2 +- base/psblas/psb_zgetmatinfo.F90 | 4 +- base/psblas/psb_zspmm.f90 | 2 +- base/psblas/psb_zspsm.f90 | 2 +- base/serial/impl/psb_c_coo_impl.F90 | 79 ++++--- base/serial/impl/psb_c_csc_impl.F90 | 4 +- base/serial/impl/psb_c_csr_impl.F90 | 14 +- base/serial/impl/psb_c_mat_impl.F90 | 4 +- base/serial/impl/psb_c_rb_idx_tree_impl.F90 | 6 +- base/serial/impl/psb_d_coo_impl.F90 | 79 ++++--- base/serial/impl/psb_d_csc_impl.F90 | 4 +- base/serial/impl/psb_d_csr_impl.F90 | 14 +- base/serial/impl/psb_d_mat_impl.F90 | 4 +- base/serial/impl/psb_d_rb_idx_tree_impl.F90 | 6 +- base/serial/impl/psb_s_coo_impl.F90 | 79 ++++--- base/serial/impl/psb_s_csc_impl.F90 | 4 +- base/serial/impl/psb_s_csr_impl.F90 | 14 +- base/serial/impl/psb_s_mat_impl.F90 | 4 +- base/serial/impl/psb_s_rb_idx_tree_impl.F90 | 6 +- base/serial/impl/psb_z_coo_impl.F90 | 79 ++++--- base/serial/impl/psb_z_csc_impl.F90 | 4 +- base/serial/impl/psb_z_csr_impl.F90 | 14 +- base/serial/impl/psb_z_mat_impl.F90 | 4 +- base/serial/impl/psb_z_rb_idx_tree_impl.F90 | 6 +- base/serial/psi_c_serial_impl.F90 | 6 +- base/serial/psi_d_serial_impl.F90 | 6 +- base/serial/psi_e_serial_impl.F90 | 6 +- base/serial/psi_i2_serial_impl.F90 | 6 +- base/serial/psi_m_serial_impl.F90 | 6 +- base/serial/psi_s_serial_impl.F90 | 6 +- base/serial/psi_z_serial_impl.F90 | 6 +- base/tools/psb_c_glob_transpose.F90 | 8 +- base/tools/psb_c_remote_mat.F90 | 4 +- base/tools/psb_c_remote_vect.F90 | 4 +- base/tools/psb_ccdbldext.F90 | 4 +- base/tools/psb_cdins.F90 | 4 +- base/tools/psb_csphalo.F90 | 20 +- base/tools/psb_cspins.F90 | 44 ++-- base/tools/psb_d_glob_transpose.F90 | 8 +- base/tools/psb_d_remote_mat.F90 | 4 +- base/tools/psb_d_remote_vect.F90 | 4 +- base/tools/psb_dcdbldext.F90 | 4 +- base/tools/psb_dsphalo.F90 | 20 +- base/tools/psb_dspins.F90 | 44 ++-- base/tools/psb_e_remote_vect.F90 | 4 +- base/tools/psb_i2_remote_vect.F90 | 4 +- base/tools/psb_icdasb.F90 | 4 +- base/tools/psb_m_remote_vect.F90 | 4 +- base/tools/psb_s_glob_transpose.F90 | 8 +- base/tools/psb_s_remote_mat.F90 | 4 +- base/tools/psb_s_remote_vect.F90 | 4 +- base/tools/psb_scdbldext.F90 | 4 +- base/tools/psb_ssphalo.F90 | 20 +- base/tools/psb_sspins.F90 | 44 ++-- base/tools/psb_z_glob_transpose.F90 | 8 +- base/tools/psb_z_remote_mat.F90 | 4 +- base/tools/psb_z_remote_vect.F90 | 4 +- base/tools/psb_zcdbldext.F90 | 4 +- base/tools/psb_zsphalo.F90 | 20 +- base/tools/psb_zspins.F90 | 44 ++-- cbind/base/psb_c_tools_cbind_mod.F90 | 6 +- cbind/base/psb_d_tools_cbind_mod.F90 | 6 +- cbind/base/psb_s_tools_cbind_mod.F90 | 6 +- cbind/base/psb_z_tools_cbind_mod.F90 | 6 +- configure | 88 ++++---- configure.ac | 98 ++++----- cuda/c_cusparse_mod.F90 | 6 +- cuda/ccusparse.h | 4 +- cuda/d_cusparse_mod.F90 | 6 +- cuda/dcusparse.h | 4 +- cuda/fcusparse.h | 2 +- cuda/fcusparse_dat.h | 12 +- cuda/fcusparse_fct.h | 26 +-- cuda/impl/psb_c_cuda_cp_hybg_from_coo.F90 | 2 +- cuda/impl/psb_c_cuda_cp_hybg_from_fmt.F90 | 2 +- cuda/impl/psb_c_cuda_csrg_from_gpu.F90 | 2 +- cuda/impl/psb_c_cuda_csrg_to_gpu.F90 | 4 +- cuda/impl/psb_c_cuda_dnsg_mat_impl.F90 | 12 -- cuda/impl/psb_c_cuda_hybg_allocate_mnnz.F90 | 2 +- cuda/impl/psb_c_cuda_hybg_csmm.F90 | 2 +- cuda/impl/psb_c_cuda_hybg_csmv.F90 | 2 +- cuda/impl/psb_c_cuda_hybg_inner_vect_sv.F90 | 2 +- cuda/impl/psb_c_cuda_hybg_mold.F90 | 2 +- cuda/impl/psb_c_cuda_hybg_reallocate_nz.F90 | 2 +- cuda/impl/psb_c_cuda_hybg_scal.F90 | 2 +- cuda/impl/psb_c_cuda_hybg_scals.F90 | 2 +- cuda/impl/psb_c_cuda_hybg_to_gpu.F90 | 2 +- cuda/impl/psb_c_cuda_hybg_vect_mv.F90 | 2 +- cuda/impl/psb_c_cuda_mv_hybg_from_coo.F90 | 2 +- cuda/impl/psb_c_cuda_mv_hybg_from_fmt.F90 | 2 +- cuda/impl/psb_d_cuda_cp_hybg_from_coo.F90 | 2 +- cuda/impl/psb_d_cuda_cp_hybg_from_fmt.F90 | 2 +- cuda/impl/psb_d_cuda_csrg_from_gpu.F90 | 2 +- cuda/impl/psb_d_cuda_csrg_to_gpu.F90 | 4 +- cuda/impl/psb_d_cuda_dnsg_mat_impl.F90 | 12 -- cuda/impl/psb_d_cuda_hybg_allocate_mnnz.F90 | 2 +- cuda/impl/psb_d_cuda_hybg_csmm.F90 | 2 +- cuda/impl/psb_d_cuda_hybg_csmv.F90 | 2 +- cuda/impl/psb_d_cuda_hybg_inner_vect_sv.F90 | 2 +- cuda/impl/psb_d_cuda_hybg_mold.F90 | 2 +- cuda/impl/psb_d_cuda_hybg_reallocate_nz.F90 | 2 +- cuda/impl/psb_d_cuda_hybg_scal.F90 | 2 +- cuda/impl/psb_d_cuda_hybg_scals.F90 | 2 +- cuda/impl/psb_d_cuda_hybg_to_gpu.F90 | 2 +- cuda/impl/psb_d_cuda_hybg_vect_mv.F90 | 2 +- cuda/impl/psb_d_cuda_mv_hybg_from_coo.F90 | 2 +- cuda/impl/psb_d_cuda_mv_hybg_from_fmt.F90 | 2 +- cuda/impl/psb_s_cuda_cp_hybg_from_coo.F90 | 2 +- cuda/impl/psb_s_cuda_cp_hybg_from_fmt.F90 | 2 +- cuda/impl/psb_s_cuda_csrg_from_gpu.F90 | 2 +- cuda/impl/psb_s_cuda_csrg_to_gpu.F90 | 4 +- cuda/impl/psb_s_cuda_dnsg_mat_impl.F90 | 12 -- cuda/impl/psb_s_cuda_hybg_allocate_mnnz.F90 | 2 +- cuda/impl/psb_s_cuda_hybg_csmm.F90 | 2 +- cuda/impl/psb_s_cuda_hybg_csmv.F90 | 2 +- cuda/impl/psb_s_cuda_hybg_inner_vect_sv.F90 | 2 +- cuda/impl/psb_s_cuda_hybg_mold.F90 | 2 +- cuda/impl/psb_s_cuda_hybg_reallocate_nz.F90 | 2 +- cuda/impl/psb_s_cuda_hybg_scal.F90 | 2 +- cuda/impl/psb_s_cuda_hybg_scals.F90 | 2 +- cuda/impl/psb_s_cuda_hybg_to_gpu.F90 | 2 +- cuda/impl/psb_s_cuda_hybg_vect_mv.F90 | 2 +- cuda/impl/psb_s_cuda_mv_hybg_from_coo.F90 | 2 +- cuda/impl/psb_s_cuda_mv_hybg_from_fmt.F90 | 2 +- cuda/impl/psb_z_cuda_cp_hybg_from_coo.F90 | 2 +- cuda/impl/psb_z_cuda_cp_hybg_from_fmt.F90 | 2 +- cuda/impl/psb_z_cuda_csrg_from_gpu.F90 | 2 +- cuda/impl/psb_z_cuda_csrg_to_gpu.F90 | 4 +- cuda/impl/psb_z_cuda_dnsg_mat_impl.F90 | 12 -- cuda/impl/psb_z_cuda_hybg_allocate_mnnz.F90 | 2 +- cuda/impl/psb_z_cuda_hybg_csmm.F90 | 2 +- cuda/impl/psb_z_cuda_hybg_csmv.F90 | 2 +- cuda/impl/psb_z_cuda_hybg_inner_vect_sv.F90 | 2 +- cuda/impl/psb_z_cuda_hybg_mold.F90 | 2 +- cuda/impl/psb_z_cuda_hybg_reallocate_nz.F90 | 2 +- cuda/impl/psb_z_cuda_hybg_scal.F90 | 2 +- cuda/impl/psb_z_cuda_hybg_scals.F90 | 2 +- cuda/impl/psb_z_cuda_hybg_to_gpu.F90 | 2 +- cuda/impl/psb_z_cuda_hybg_vect_mv.F90 | 2 +- cuda/impl/psb_z_cuda_mv_hybg_from_coo.F90 | 2 +- cuda/impl/psb_z_cuda_mv_hybg_from_fmt.F90 | 2 +- cuda/psb_c_cuda_diag_mat_mod.F90 | 2 - cuda/psb_c_cuda_dnsg_mat_mod.F90 | 2 - cuda/psb_c_cuda_elg_mat_mod.F90 | 2 - cuda/psb_c_cuda_hlg_mat_mod.F90 | 2 - cuda/psb_c_cuda_hybg_mat_mod.F90 | 2 +- cuda/psb_cuda_env_mod.F90 | 2 +- cuda/psb_cuda_mod.F90 | 2 +- cuda/psb_d_cuda_diag_mat_mod.F90 | 2 - cuda/psb_d_cuda_dnsg_mat_mod.F90 | 2 - cuda/psb_d_cuda_elg_mat_mod.F90 | 2 - cuda/psb_d_cuda_hlg_mat_mod.F90 | 2 - cuda/psb_d_cuda_hybg_mat_mod.F90 | 2 +- cuda/psb_i_cuda_diag_mat_mod.F90 | 2 - cuda/psb_i_cuda_dnsg_mat_mod.F90 | 2 - cuda/psb_i_cuda_elg_mat_mod.F90 | 2 - cuda/psb_i_cuda_hlg_mat_mod.F90 | 2 - cuda/psb_i_cuda_hybg_mat_mod.F90 | 2 +- cuda/psb_s_cuda_diag_mat_mod.F90 | 2 - cuda/psb_s_cuda_dnsg_mat_mod.F90 | 2 - cuda/psb_s_cuda_elg_mat_mod.F90 | 2 - cuda/psb_s_cuda_hlg_mat_mod.F90 | 2 - cuda/psb_s_cuda_hybg_mat_mod.F90 | 2 +- cuda/psb_z_cuda_diag_mat_mod.F90 | 2 - cuda/psb_z_cuda_dnsg_mat_mod.F90 | 2 - cuda/psb_z_cuda_elg_mat_mod.F90 | 2 - cuda/psb_z_cuda_hlg_mat_mod.F90 | 2 - cuda/psb_z_cuda_hybg_mat_mod.F90 | 2 +- cuda/s_cusparse_mod.F90 | 6 +- cuda/scusparse.h | 4 +- cuda/z_cusparse_mod.F90 | 6 +- cuda/zcusparse.h | 4 +- linsolve/impl/psb_dcg.F90 | 2 +- linsolve/impl/psb_scg.F90 | 2 +- prec/psb_c_biconjg_mod.F90 | 10 +- prec/psb_d_biconjg_mod.F90 | 10 +- prec/psb_s_biconjg_mod.F90 | 10 +- prec/psb_z_biconjg_mod.F90 | 10 +- test/cudakern/dpdegenmv.F90 | 28 +-- test/cudakern/spdegenmv.F90 | 28 +-- test/omp/psb_tomp.F90 | 12 +- test/openacc/psb_d_oacc_pde3d.F90 | 8 +- test/pargen/psb_d_pde2d.F90 | 24 ++- test/pargen/psb_d_pde3d.F90 | 25 ++- test/pargen/psb_s_pde2d.F90 | 24 ++- test/pargen/psb_s_pde3d.F90 | 25 ++- util/psb_amd_order.c | 5 +- util/psb_c_renum_impl.F90 | 12 +- util/psb_d_renum_impl.F90 | 12 +- util/psb_i_mmio_impl.F90 | 2 +- util/psb_metis_int.c | 6 +- util/psb_metis_int.h.in | 21 +- util/psb_metispart_mod.F90 | 20 +- util/psb_mmio_mod.F90 | 10 +- util/psb_s_renum_impl.F90 | 12 +- util/psb_z_renum_impl.F90 | 12 +- util/psi_build_mtpart.F90 | 50 ++--- 313 files changed, 3093 insertions(+), 2802 deletions(-) mode change 100755 => 100644 configure.ac diff --git a/Make.inc.in b/Make.inc.in index 9a1999f5..2c705253 100755 --- a/Make.inc.in +++ b/Make.inc.in @@ -83,8 +83,8 @@ SPGPU_LIBS=@SPGPU_LIBS@ CUDA_DIR=@CUDA_DIR@ CUDA_INCLUDES=@CUDA_INCLUDES@ CUDA_LIBS=@CUDA_LIBS@ -CUDA_VERSION=@CUDA_VERSION@ -CUDA_SHORT_VERSION=@CUDA_SHORT_VERSION@ +PSB_CUDA_VERSION=@PSB_CUDA_VERSION@ +PSB_CUDA_SHORT_VERSION=@PSB_CUDA_SHORT_VERSION@ CUDA_DEFINES=@CUDA_DEFINES@ FCUDEFINES=@FCUDEFINES@ CCUDEFINES=@CCUDEFINES@ diff --git a/base/comm/internals/psi_cswapdata.F90 b/base/comm/internals/psi_cswapdata.F90 index 5f0b8bdc..92d58e5e 100644 --- a/base/comm/internals/psi_cswapdata.F90 +++ b/base/comm/internals/psi_cswapdata.F90 @@ -96,11 +96,11 @@ subroutine psi_cswapdata_vect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -184,11 +184,11 @@ subroutine psi_cswap_vidx_vect(ctxt,icomm,flag,beta,y,idx, & use psb_desc_mod use psb_penv_mod use psb_c_base_vect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -434,11 +434,11 @@ subroutine psi_cswapdata_multivect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -522,11 +522,11 @@ subroutine psi_cswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx, & use psb_desc_mod use psb_penv_mod use psb_c_base_multivect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_cswapdata_a.F90 b/base/comm/internals/psi_cswapdata_a.F90 index acf7f342..e3368e0a 100644 --- a/base/comm/internals/psi_cswapdata_a.F90 +++ b/base/comm/internals/psi_cswapdata_a.F90 @@ -90,11 +90,11 @@ subroutine psi_cswapdatam(flag,n,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -161,11 +161,11 @@ subroutine psi_cswapidxm(ctxt,icomm,flag,n,beta,y,idx, & use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -567,11 +567,11 @@ subroutine psi_cswapdatav(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -649,11 +649,11 @@ subroutine psi_cswapidxv(ctxt,icomm,flag,beta,y,idx, & use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_cswaptran.F90 b/base/comm/internals/psi_cswaptran.F90 index aefb6b01..fac810b8 100644 --- a/base/comm/internals/psi_cswaptran.F90 +++ b/base/comm/internals/psi_cswaptran.F90 @@ -98,11 +98,11 @@ subroutine psi_cswaptran_vect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -185,11 +185,11 @@ subroutine psi_ctran_vidx_vect(ctxt,icomm,flag,beta,y,idx,& use psb_desc_mod use psb_penv_mod use psb_c_base_vect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -445,11 +445,11 @@ subroutine psi_cswaptran_multivect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -533,11 +533,11 @@ subroutine psi_ctran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,& use psb_desc_mod use psb_penv_mod use psb_c_base_multivect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_cswaptran_a.F90 b/base/comm/internals/psi_cswaptran_a.F90 index 0aa5d6f6..d1b80a2f 100644 --- a/base/comm/internals/psi_cswaptran_a.F90 +++ b/base/comm/internals/psi_cswaptran_a.F90 @@ -94,11 +94,11 @@ subroutine psi_cswaptranm(flag,n,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -166,11 +166,11 @@ subroutine psi_ctranidxm(ctxt,icomm,flag,n,beta,y,idx,& use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -579,11 +579,11 @@ subroutine psi_cswaptranv(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -661,11 +661,11 @@ subroutine psi_ctranidxv(ctxt,icomm,flag,beta,y,idx,& use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_dswapdata.F90 b/base/comm/internals/psi_dswapdata.F90 index fe529706..af5d6062 100644 --- a/base/comm/internals/psi_dswapdata.F90 +++ b/base/comm/internals/psi_dswapdata.F90 @@ -96,11 +96,11 @@ subroutine psi_dswapdata_vect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -184,11 +184,11 @@ subroutine psi_dswap_vidx_vect(ctxt,icomm,flag,beta,y,idx, & use psb_desc_mod use psb_penv_mod use psb_d_base_vect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -434,11 +434,11 @@ subroutine psi_dswapdata_multivect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -522,11 +522,11 @@ subroutine psi_dswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx, & use psb_desc_mod use psb_penv_mod use psb_d_base_multivect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_dswapdata_a.F90 b/base/comm/internals/psi_dswapdata_a.F90 index ff562994..869b531f 100644 --- a/base/comm/internals/psi_dswapdata_a.F90 +++ b/base/comm/internals/psi_dswapdata_a.F90 @@ -90,11 +90,11 @@ subroutine psi_dswapdatam(flag,n,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -161,11 +161,11 @@ subroutine psi_dswapidxm(ctxt,icomm,flag,n,beta,y,idx, & use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -567,11 +567,11 @@ subroutine psi_dswapdatav(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -649,11 +649,11 @@ subroutine psi_dswapidxv(ctxt,icomm,flag,beta,y,idx, & use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_dswaptran.F90 b/base/comm/internals/psi_dswaptran.F90 index df98e1ae..0b4c850d 100644 --- a/base/comm/internals/psi_dswaptran.F90 +++ b/base/comm/internals/psi_dswaptran.F90 @@ -98,11 +98,11 @@ subroutine psi_dswaptran_vect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -185,11 +185,11 @@ subroutine psi_dtran_vidx_vect(ctxt,icomm,flag,beta,y,idx,& use psb_desc_mod use psb_penv_mod use psb_d_base_vect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -445,11 +445,11 @@ subroutine psi_dswaptran_multivect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -533,11 +533,11 @@ subroutine psi_dtran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,& use psb_desc_mod use psb_penv_mod use psb_d_base_multivect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_dswaptran_a.F90 b/base/comm/internals/psi_dswaptran_a.F90 index a0506a2b..c96c96d1 100644 --- a/base/comm/internals/psi_dswaptran_a.F90 +++ b/base/comm/internals/psi_dswaptran_a.F90 @@ -94,11 +94,11 @@ subroutine psi_dswaptranm(flag,n,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -166,11 +166,11 @@ subroutine psi_dtranidxm(ctxt,icomm,flag,n,beta,y,idx,& use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -579,11 +579,11 @@ subroutine psi_dswaptranv(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -661,11 +661,11 @@ subroutine psi_dtranidxv(ctxt,icomm,flag,beta,y,idx,& use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_eswapdata_a.F90 b/base/comm/internals/psi_eswapdata_a.F90 index acc6a6bf..fb6d0583 100644 --- a/base/comm/internals/psi_eswapdata_a.F90 +++ b/base/comm/internals/psi_eswapdata_a.F90 @@ -90,11 +90,11 @@ subroutine psi_eswapdatam(flag,n,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -161,11 +161,11 @@ subroutine psi_eswapidxm(ctxt,icomm,flag,n,beta,y,idx, & use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -567,11 +567,11 @@ subroutine psi_eswapdatav(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -649,11 +649,11 @@ subroutine psi_eswapidxv(ctxt,icomm,flag,beta,y,idx, & use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_eswaptran_a.F90 b/base/comm/internals/psi_eswaptran_a.F90 index ce12a7e7..2b82d988 100644 --- a/base/comm/internals/psi_eswaptran_a.F90 +++ b/base/comm/internals/psi_eswaptran_a.F90 @@ -94,11 +94,11 @@ subroutine psi_eswaptranm(flag,n,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -166,11 +166,11 @@ subroutine psi_etranidxm(ctxt,icomm,flag,n,beta,y,idx,& use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -579,11 +579,11 @@ subroutine psi_eswaptranv(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -661,11 +661,11 @@ subroutine psi_etranidxv(ctxt,icomm,flag,beta,y,idx,& use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_i2swapdata_a.F90 b/base/comm/internals/psi_i2swapdata_a.F90 index e2a8ad4e..58b1aeca 100644 --- a/base/comm/internals/psi_i2swapdata_a.F90 +++ b/base/comm/internals/psi_i2swapdata_a.F90 @@ -90,11 +90,11 @@ subroutine psi_i2swapdatam(flag,n,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -161,11 +161,11 @@ subroutine psi_i2swapidxm(ctxt,icomm,flag,n,beta,y,idx, & use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -567,11 +567,11 @@ subroutine psi_i2swapdatav(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -649,11 +649,11 @@ subroutine psi_i2swapidxv(ctxt,icomm,flag,beta,y,idx, & use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_i2swaptran_a.F90 b/base/comm/internals/psi_i2swaptran_a.F90 index 36652565..02ccc221 100644 --- a/base/comm/internals/psi_i2swaptran_a.F90 +++ b/base/comm/internals/psi_i2swaptran_a.F90 @@ -94,11 +94,11 @@ subroutine psi_i2swaptranm(flag,n,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -166,11 +166,11 @@ subroutine psi_i2tranidxm(ctxt,icomm,flag,n,beta,y,idx,& use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -579,11 +579,11 @@ subroutine psi_i2swaptranv(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -661,11 +661,11 @@ subroutine psi_i2tranidxv(ctxt,icomm,flag,beta,y,idx,& use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_iswapdata.F90 b/base/comm/internals/psi_iswapdata.F90 index ff4bd074..1c4cf961 100644 --- a/base/comm/internals/psi_iswapdata.F90 +++ b/base/comm/internals/psi_iswapdata.F90 @@ -96,11 +96,11 @@ subroutine psi_iswapdata_vect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -184,11 +184,11 @@ subroutine psi_iswap_vidx_vect(ctxt,icomm,flag,beta,y,idx, & use psb_desc_mod use psb_penv_mod use psb_i_base_vect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -434,11 +434,11 @@ subroutine psi_iswapdata_multivect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -522,11 +522,11 @@ subroutine psi_iswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx, & use psb_desc_mod use psb_penv_mod use psb_i_base_multivect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_iswaptran.F90 b/base/comm/internals/psi_iswaptran.F90 index 75a0a185..151f53f1 100644 --- a/base/comm/internals/psi_iswaptran.F90 +++ b/base/comm/internals/psi_iswaptran.F90 @@ -98,11 +98,11 @@ subroutine psi_iswaptran_vect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -185,11 +185,11 @@ subroutine psi_itran_vidx_vect(ctxt,icomm,flag,beta,y,idx,& use psb_desc_mod use psb_penv_mod use psb_i_base_vect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -445,11 +445,11 @@ subroutine psi_iswaptran_multivect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -533,11 +533,11 @@ subroutine psi_itran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,& use psb_desc_mod use psb_penv_mod use psb_i_base_multivect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_lswapdata.F90 b/base/comm/internals/psi_lswapdata.F90 index 9201ebfa..ecb94a74 100644 --- a/base/comm/internals/psi_lswapdata.F90 +++ b/base/comm/internals/psi_lswapdata.F90 @@ -96,11 +96,11 @@ subroutine psi_lswapdata_vect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -184,11 +184,11 @@ subroutine psi_lswap_vidx_vect(ctxt,icomm,flag,beta,y,idx, & use psb_desc_mod use psb_penv_mod use psb_l_base_vect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -434,11 +434,11 @@ subroutine psi_lswapdata_multivect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -522,11 +522,11 @@ subroutine psi_lswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx, & use psb_desc_mod use psb_penv_mod use psb_l_base_multivect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_lswaptran.F90 b/base/comm/internals/psi_lswaptran.F90 index b2b9536c..9f9c98fb 100644 --- a/base/comm/internals/psi_lswaptran.F90 +++ b/base/comm/internals/psi_lswaptran.F90 @@ -98,11 +98,11 @@ subroutine psi_lswaptran_vect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -185,11 +185,11 @@ subroutine psi_ltran_vidx_vect(ctxt,icomm,flag,beta,y,idx,& use psb_desc_mod use psb_penv_mod use psb_l_base_vect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -445,11 +445,11 @@ subroutine psi_lswaptran_multivect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -533,11 +533,11 @@ subroutine psi_ltran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,& use psb_desc_mod use psb_penv_mod use psb_l_base_multivect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_mswapdata_a.F90 b/base/comm/internals/psi_mswapdata_a.F90 index c7f1965b..4101805c 100644 --- a/base/comm/internals/psi_mswapdata_a.F90 +++ b/base/comm/internals/psi_mswapdata_a.F90 @@ -90,11 +90,11 @@ subroutine psi_mswapdatam(flag,n,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -161,11 +161,11 @@ subroutine psi_mswapidxm(ctxt,icomm,flag,n,beta,y,idx, & use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -567,11 +567,11 @@ subroutine psi_mswapdatav(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -649,11 +649,11 @@ subroutine psi_mswapidxv(ctxt,icomm,flag,beta,y,idx, & use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_mswaptran_a.F90 b/base/comm/internals/psi_mswaptran_a.F90 index 1e9fcede..dac51c9b 100644 --- a/base/comm/internals/psi_mswaptran_a.F90 +++ b/base/comm/internals/psi_mswaptran_a.F90 @@ -94,11 +94,11 @@ subroutine psi_mswaptranm(flag,n,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -166,11 +166,11 @@ subroutine psi_mtranidxm(ctxt,icomm,flag,n,beta,y,idx,& use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -579,11 +579,11 @@ subroutine psi_mswaptranv(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -661,11 +661,11 @@ subroutine psi_mtranidxv(ctxt,icomm,flag,beta,y,idx,& use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_sswapdata.F90 b/base/comm/internals/psi_sswapdata.F90 index e4f11bd0..0ab5e1ca 100644 --- a/base/comm/internals/psi_sswapdata.F90 +++ b/base/comm/internals/psi_sswapdata.F90 @@ -96,11 +96,11 @@ subroutine psi_sswapdata_vect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -184,11 +184,11 @@ subroutine psi_sswap_vidx_vect(ctxt,icomm,flag,beta,y,idx, & use psb_desc_mod use psb_penv_mod use psb_s_base_vect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -434,11 +434,11 @@ subroutine psi_sswapdata_multivect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -522,11 +522,11 @@ subroutine psi_sswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx, & use psb_desc_mod use psb_penv_mod use psb_s_base_multivect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_sswapdata_a.F90 b/base/comm/internals/psi_sswapdata_a.F90 index c802578c..3eed18d9 100644 --- a/base/comm/internals/psi_sswapdata_a.F90 +++ b/base/comm/internals/psi_sswapdata_a.F90 @@ -90,11 +90,11 @@ subroutine psi_sswapdatam(flag,n,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -161,11 +161,11 @@ subroutine psi_sswapidxm(ctxt,icomm,flag,n,beta,y,idx, & use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -567,11 +567,11 @@ subroutine psi_sswapdatav(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -649,11 +649,11 @@ subroutine psi_sswapidxv(ctxt,icomm,flag,beta,y,idx, & use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_sswaptran.F90 b/base/comm/internals/psi_sswaptran.F90 index 90c4b275..deb49919 100644 --- a/base/comm/internals/psi_sswaptran.F90 +++ b/base/comm/internals/psi_sswaptran.F90 @@ -98,11 +98,11 @@ subroutine psi_sswaptran_vect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -185,11 +185,11 @@ subroutine psi_stran_vidx_vect(ctxt,icomm,flag,beta,y,idx,& use psb_desc_mod use psb_penv_mod use psb_s_base_vect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -445,11 +445,11 @@ subroutine psi_sswaptran_multivect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -533,11 +533,11 @@ subroutine psi_stran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,& use psb_desc_mod use psb_penv_mod use psb_s_base_multivect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_sswaptran_a.F90 b/base/comm/internals/psi_sswaptran_a.F90 index c4290be1..cd87ace6 100644 --- a/base/comm/internals/psi_sswaptran_a.F90 +++ b/base/comm/internals/psi_sswaptran_a.F90 @@ -94,11 +94,11 @@ subroutine psi_sswaptranm(flag,n,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -166,11 +166,11 @@ subroutine psi_stranidxm(ctxt,icomm,flag,n,beta,y,idx,& use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -579,11 +579,11 @@ subroutine psi_sswaptranv(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -661,11 +661,11 @@ subroutine psi_stranidxv(ctxt,icomm,flag,beta,y,idx,& use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_zswapdata.F90 b/base/comm/internals/psi_zswapdata.F90 index 991d6e40..af683671 100644 --- a/base/comm/internals/psi_zswapdata.F90 +++ b/base/comm/internals/psi_zswapdata.F90 @@ -96,11 +96,11 @@ subroutine psi_zswapdata_vect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -184,11 +184,11 @@ subroutine psi_zswap_vidx_vect(ctxt,icomm,flag,beta,y,idx, & use psb_desc_mod use psb_penv_mod use psb_z_base_vect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -434,11 +434,11 @@ subroutine psi_zswapdata_multivect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -522,11 +522,11 @@ subroutine psi_zswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx, & use psb_desc_mod use psb_penv_mod use psb_z_base_multivect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_zswapdata_a.F90 b/base/comm/internals/psi_zswapdata_a.F90 index ec21072c..85cda7b7 100644 --- a/base/comm/internals/psi_zswapdata_a.F90 +++ b/base/comm/internals/psi_zswapdata_a.F90 @@ -90,11 +90,11 @@ subroutine psi_zswapdatam(flag,n,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -161,11 +161,11 @@ subroutine psi_zswapidxm(ctxt,icomm,flag,n,beta,y,idx, & use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -567,11 +567,11 @@ subroutine psi_zswapdatav(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -649,11 +649,11 @@ subroutine psi_zswapidxv(ctxt,icomm,flag,beta,y,idx, & use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_zswaptran.F90 b/base/comm/internals/psi_zswaptran.F90 index f027519f..1150b471 100644 --- a/base/comm/internals/psi_zswaptran.F90 +++ b/base/comm/internals/psi_zswaptran.F90 @@ -98,11 +98,11 @@ subroutine psi_zswaptran_vect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -185,11 +185,11 @@ subroutine psi_ztran_vidx_vect(ctxt,icomm,flag,beta,y,idx,& use psb_desc_mod use psb_penv_mod use psb_z_base_vect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -445,11 +445,11 @@ subroutine psi_zswaptran_multivect(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -533,11 +533,11 @@ subroutine psi_ztran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,& use psb_desc_mod use psb_penv_mod use psb_z_base_multivect_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/internals/psi_zswaptran_a.F90 b/base/comm/internals/psi_zswaptran_a.F90 index c1062839..2eaed34d 100644 --- a/base/comm/internals/psi_zswaptran_a.F90 +++ b/base/comm/internals/psi_zswaptran_a.F90 @@ -94,11 +94,11 @@ subroutine psi_zswaptranm(flag,n,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -166,11 +166,11 @@ subroutine psi_ztranidxm(ctxt,icomm,flag,n,beta,y,idx,& use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -579,11 +579,11 @@ subroutine psi_zswaptranv(flag,beta,y,desc_a,work,info,data) use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -661,11 +661,11 @@ subroutine psi_ztranidxv(ctxt,icomm,flag,beta,y,idx,& use psb_error_mod use psb_desc_mod use psb_penv_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/comm/psb_cscatter_a.F90 b/base/comm/psb_cscatter_a.F90 index 38d922e2..542356d4 100644 --- a/base/comm/psb_cscatter_a.F90 +++ b/base/comm/psb_cscatter_a.F90 @@ -46,11 +46,11 @@ subroutine psb_cscatterm(globx, locx, desc_a, info, root) use psb_base_mod, psb_protect_name => psb_cscatterm -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -162,8 +162,8 @@ subroutine psb_cscatterm(globx, locx, desc_a, info, root) rootrank = psb_get_mpi_rank(ctxt,iroot) ! - ! This is potentially unsafe when IPK=8 - ! But then, IPK=8 is highly experimental anyway. + ! This is potentially unsafe when PSB_IPK=8 + ! But then, PSB_IPK=8 is highly experimental anyway. ! nlr = nrow call mpi_gather(nlr,1,psb_mpi_mpk_,all_dim,& @@ -291,11 +291,11 @@ end subroutine psb_cscatterm ! subroutine psb_cscatterv(globx, locx, desc_a, info, root) use psb_base_mod, psb_protect_name => psb_cscatterv -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -398,8 +398,8 @@ subroutine psb_cscatterv(globx, locx, desc_a, info, root) else rootrank = psb_get_mpi_rank(ctxt,iroot) ! - ! This is potentially unsafe when IPK=8 - ! But then, IPK=8 is highly experimental anyway. + ! This is potentially unsafe when PSB_IPK=8 + ! But then, PSB_IPK=8 is highly experimental anyway. ! nlr = nrow call mpi_gather(nlr,1,psb_mpi_mpk_,all_dim,& diff --git a/base/comm/psb_cspgather.F90 b/base/comm/psb_cspgather.F90 index 675046bf..d1bde487 100644 --- a/base/comm/psb_cspgather.F90 +++ b/base/comm/psb_cspgather.F90 @@ -33,8 +33,8 @@ ! ! Gathers a sparse matrix onto a single process. ! Two variants: -! 1. Gathers to PSB_c_SPARSE_MAT (i.e. to matrix with IPK_ indices) -! 2. Gathers to PSB_lc_SPARSE_MAT (i.e. to matrix with LPK_ indices) +! 1. Gathers to PSB_c_SPARSE_MAT (i.e. to matrix with PSB_IPK_ indices) +! 2. Gathers to PSB_lc_SPARSE_MAT (i.e. to matrix with PSB_LPK_ indices) ! ! Note: this function uses MPI_ALLGATHERV. At this time, the size of the ! resulting matrix must be within the range of 4 bytes because of the @@ -49,11 +49,11 @@ subroutine psb_csp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keep use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_cspmat_type), intent(inout) :: loca @@ -233,11 +233,11 @@ subroutine psb_lcsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,kee use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_cspmat_type), intent(inout) :: loca @@ -406,11 +406,11 @@ subroutine psb_lclcsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,k use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_lcspmat_type), intent(inout) :: loca diff --git a/base/comm/psb_dscatter_a.F90 b/base/comm/psb_dscatter_a.F90 index 0f3be5aa..67058e67 100644 --- a/base/comm/psb_dscatter_a.F90 +++ b/base/comm/psb_dscatter_a.F90 @@ -46,11 +46,11 @@ subroutine psb_dscatterm(globx, locx, desc_a, info, root) use psb_base_mod, psb_protect_name => psb_dscatterm -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -162,8 +162,8 @@ subroutine psb_dscatterm(globx, locx, desc_a, info, root) rootrank = psb_get_mpi_rank(ctxt,iroot) ! - ! This is potentially unsafe when IPK=8 - ! But then, IPK=8 is highly experimental anyway. + ! This is potentially unsafe when PSB_IPK=8 + ! But then, PSB_IPK=8 is highly experimental anyway. ! nlr = nrow call mpi_gather(nlr,1,psb_mpi_mpk_,all_dim,& @@ -291,11 +291,11 @@ end subroutine psb_dscatterm ! subroutine psb_dscatterv(globx, locx, desc_a, info, root) use psb_base_mod, psb_protect_name => psb_dscatterv -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -398,8 +398,8 @@ subroutine psb_dscatterv(globx, locx, desc_a, info, root) else rootrank = psb_get_mpi_rank(ctxt,iroot) ! - ! This is potentially unsafe when IPK=8 - ! But then, IPK=8 is highly experimental anyway. + ! This is potentially unsafe when PSB_IPK=8 + ! But then, PSB_IPK=8 is highly experimental anyway. ! nlr = nrow call mpi_gather(nlr,1,psb_mpi_mpk_,all_dim,& diff --git a/base/comm/psb_dspgather.F90 b/base/comm/psb_dspgather.F90 index da86790a..98a9bc91 100644 --- a/base/comm/psb_dspgather.F90 +++ b/base/comm/psb_dspgather.F90 @@ -33,8 +33,8 @@ ! ! Gathers a sparse matrix onto a single process. ! Two variants: -! 1. Gathers to PSB_d_SPARSE_MAT (i.e. to matrix with IPK_ indices) -! 2. Gathers to PSB_ld_SPARSE_MAT (i.e. to matrix with LPK_ indices) +! 1. Gathers to PSB_d_SPARSE_MAT (i.e. to matrix with PSB_IPK_ indices) +! 2. Gathers to PSB_ld_SPARSE_MAT (i.e. to matrix with PSB_LPK_ indices) ! ! Note: this function uses MPI_ALLGATHERV. At this time, the size of the ! resulting matrix must be within the range of 4 bytes because of the @@ -49,11 +49,11 @@ subroutine psb_dsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keep use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_dspmat_type), intent(inout) :: loca @@ -233,11 +233,11 @@ subroutine psb_ldsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,kee use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_dspmat_type), intent(inout) :: loca @@ -406,11 +406,11 @@ subroutine psb_ldldsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,k use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ldspmat_type), intent(inout) :: loca diff --git a/base/comm/psb_escatter_a.F90 b/base/comm/psb_escatter_a.F90 index e2b45f5c..d059e9e9 100644 --- a/base/comm/psb_escatter_a.F90 +++ b/base/comm/psb_escatter_a.F90 @@ -46,11 +46,11 @@ subroutine psb_escatterm(globx, locx, desc_a, info, root) use psb_base_mod, psb_protect_name => psb_escatterm -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -162,8 +162,8 @@ subroutine psb_escatterm(globx, locx, desc_a, info, root) rootrank = psb_get_mpi_rank(ctxt,iroot) ! - ! This is potentially unsafe when IPK=8 - ! But then, IPK=8 is highly experimental anyway. + ! This is potentially unsafe when PSB_IPK=8 + ! But then, PSB_IPK=8 is highly experimental anyway. ! nlr = nrow call mpi_gather(nlr,1,psb_mpi_mpk_,all_dim,& @@ -291,11 +291,11 @@ end subroutine psb_escatterm ! subroutine psb_escatterv(globx, locx, desc_a, info, root) use psb_base_mod, psb_protect_name => psb_escatterv -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -398,8 +398,8 @@ subroutine psb_escatterv(globx, locx, desc_a, info, root) else rootrank = psb_get_mpi_rank(ctxt,iroot) ! - ! This is potentially unsafe when IPK=8 - ! But then, IPK=8 is highly experimental anyway. + ! This is potentially unsafe when PSB_IPK=8 + ! But then, PSB_IPK=8 is highly experimental anyway. ! nlr = nrow call mpi_gather(nlr,1,psb_mpi_mpk_,all_dim,& diff --git a/base/comm/psb_i2scatter_a.F90 b/base/comm/psb_i2scatter_a.F90 index 960e48b0..fd135324 100644 --- a/base/comm/psb_i2scatter_a.F90 +++ b/base/comm/psb_i2scatter_a.F90 @@ -46,11 +46,11 @@ subroutine psb_i2scatterm(globx, locx, desc_a, info, root) use psb_base_mod, psb_protect_name => psb_i2scatterm -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -162,8 +162,8 @@ subroutine psb_i2scatterm(globx, locx, desc_a, info, root) rootrank = psb_get_mpi_rank(ctxt,iroot) ! - ! This is potentially unsafe when IPK=8 - ! But then, IPK=8 is highly experimental anyway. + ! This is potentially unsafe when PSB_IPK=8 + ! But then, PSB_IPK=8 is highly experimental anyway. ! nlr = nrow call mpi_gather(nlr,1,psb_mpi_mpk_,all_dim,& @@ -291,11 +291,11 @@ end subroutine psb_i2scatterm ! subroutine psb_i2scatterv(globx, locx, desc_a, info, root) use psb_base_mod, psb_protect_name => psb_i2scatterv -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -398,8 +398,8 @@ subroutine psb_i2scatterv(globx, locx, desc_a, info, root) else rootrank = psb_get_mpi_rank(ctxt,iroot) ! - ! This is potentially unsafe when IPK=8 - ! But then, IPK=8 is highly experimental anyway. + ! This is potentially unsafe when PSB_IPK=8 + ! But then, PSB_IPK=8 is highly experimental anyway. ! nlr = nrow call mpi_gather(nlr,1,psb_mpi_mpk_,all_dim,& diff --git a/base/comm/psb_ispgather.F90 b/base/comm/psb_ispgather.F90 index c51519bf..773c5864 100644 --- a/base/comm/psb_ispgather.F90 +++ b/base/comm/psb_ispgather.F90 @@ -33,8 +33,8 @@ ! ! Gathers a sparse matrix onto a single process. ! Two variants: -! 1. Gathers to PSB_i_SPARSE_MAT (i.e. to matrix with IPK_ indices) -! 2. Gathers to PSB_@LX@_SPARSE_MAT (i.e. to matrix with LPK_ indices) +! 1. Gathers to PSB_i_SPARSE_MAT (i.e. to matrix with PSB_IPK_ indices) +! 2. Gathers to PSB_@LX@_SPARSE_MAT (i.e. to matrix with PSB_LPK_ indices) ! ! Note: this function uses MPI_ALLGATHERV. At this time, the size of the ! resulting matrix must be within the range of 4 bytes because of the @@ -49,11 +49,11 @@ subroutine psb_isp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keep use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ispmat_type), intent(inout) :: loca @@ -233,11 +233,11 @@ subroutine psb_@LX@sp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,k use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ispmat_type), intent(inout) :: loca @@ -406,11 +406,11 @@ subroutine psb_@LX@@LX@sp_allgather(globa, loca, desc_a, info, root, dupl,keepn use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_@LX@spmat_type), intent(inout) :: loca diff --git a/base/comm/psb_lspgather.F90 b/base/comm/psb_lspgather.F90 index a072811d..8cc009bf 100644 --- a/base/comm/psb_lspgather.F90 +++ b/base/comm/psb_lspgather.F90 @@ -33,8 +33,8 @@ ! ! Gathers a sparse matrix onto a single process. ! Two variants: -! 1. Gathers to PSB_l_SPARSE_MAT (i.e. to matrix with IPK_ indices) -! 2. Gathers to PSB_@LX@_SPARSE_MAT (i.e. to matrix with LPK_ indices) +! 1. Gathers to PSB_l_SPARSE_MAT (i.e. to matrix with PSB_IPK_ indices) +! 2. Gathers to PSB_@LX@_SPARSE_MAT (i.e. to matrix with PSB_LPK_ indices) ! ! Note: this function uses MPI_ALLGATHERV. At this time, the size of the ! resulting matrix must be within the range of 4 bytes because of the @@ -49,11 +49,11 @@ subroutine psb_lsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keep use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_lspmat_type), intent(inout) :: loca @@ -233,11 +233,11 @@ subroutine psb_@LX@sp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,k use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_lspmat_type), intent(inout) :: loca @@ -406,11 +406,11 @@ subroutine psb_@LX@@LX@sp_allgather(globa, loca, desc_a, info, root, dupl,keepn use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_@LX@spmat_type), intent(inout) :: loca diff --git a/base/comm/psb_mscatter_a.F90 b/base/comm/psb_mscatter_a.F90 index 2c6d9fbb..45271adb 100644 --- a/base/comm/psb_mscatter_a.F90 +++ b/base/comm/psb_mscatter_a.F90 @@ -46,11 +46,11 @@ subroutine psb_mscatterm(globx, locx, desc_a, info, root) use psb_base_mod, psb_protect_name => psb_mscatterm -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -162,8 +162,8 @@ subroutine psb_mscatterm(globx, locx, desc_a, info, root) rootrank = psb_get_mpi_rank(ctxt,iroot) ! - ! This is potentially unsafe when IPK=8 - ! But then, IPK=8 is highly experimental anyway. + ! This is potentially unsafe when PSB_IPK=8 + ! But then, PSB_IPK=8 is highly experimental anyway. ! nlr = nrow call mpi_gather(nlr,1,psb_mpi_mpk_,all_dim,& @@ -291,11 +291,11 @@ end subroutine psb_mscatterm ! subroutine psb_mscatterv(globx, locx, desc_a, info, root) use psb_base_mod, psb_protect_name => psb_mscatterv -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -398,8 +398,8 @@ subroutine psb_mscatterv(globx, locx, desc_a, info, root) else rootrank = psb_get_mpi_rank(ctxt,iroot) ! - ! This is potentially unsafe when IPK=8 - ! But then, IPK=8 is highly experimental anyway. + ! This is potentially unsafe when PSB_IPK=8 + ! But then, PSB_IPK=8 is highly experimental anyway. ! nlr = nrow call mpi_gather(nlr,1,psb_mpi_mpk_,all_dim,& diff --git a/base/comm/psb_sscatter_a.F90 b/base/comm/psb_sscatter_a.F90 index 08026536..48968785 100644 --- a/base/comm/psb_sscatter_a.F90 +++ b/base/comm/psb_sscatter_a.F90 @@ -46,11 +46,11 @@ subroutine psb_sscatterm(globx, locx, desc_a, info, root) use psb_base_mod, psb_protect_name => psb_sscatterm -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -162,8 +162,8 @@ subroutine psb_sscatterm(globx, locx, desc_a, info, root) rootrank = psb_get_mpi_rank(ctxt,iroot) ! - ! This is potentially unsafe when IPK=8 - ! But then, IPK=8 is highly experimental anyway. + ! This is potentially unsafe when PSB_IPK=8 + ! But then, PSB_IPK=8 is highly experimental anyway. ! nlr = nrow call mpi_gather(nlr,1,psb_mpi_mpk_,all_dim,& @@ -291,11 +291,11 @@ end subroutine psb_sscatterm ! subroutine psb_sscatterv(globx, locx, desc_a, info, root) use psb_base_mod, psb_protect_name => psb_sscatterv -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -398,8 +398,8 @@ subroutine psb_sscatterv(globx, locx, desc_a, info, root) else rootrank = psb_get_mpi_rank(ctxt,iroot) ! - ! This is potentially unsafe when IPK=8 - ! But then, IPK=8 is highly experimental anyway. + ! This is potentially unsafe when PSB_IPK=8 + ! But then, PSB_IPK=8 is highly experimental anyway. ! nlr = nrow call mpi_gather(nlr,1,psb_mpi_mpk_,all_dim,& diff --git a/base/comm/psb_sspgather.F90 b/base/comm/psb_sspgather.F90 index 79ade9c1..7e822c87 100644 --- a/base/comm/psb_sspgather.F90 +++ b/base/comm/psb_sspgather.F90 @@ -33,8 +33,8 @@ ! ! Gathers a sparse matrix onto a single process. ! Two variants: -! 1. Gathers to PSB_s_SPARSE_MAT (i.e. to matrix with IPK_ indices) -! 2. Gathers to PSB_ls_SPARSE_MAT (i.e. to matrix with LPK_ indices) +! 1. Gathers to PSB_s_SPARSE_MAT (i.e. to matrix with PSB_IPK_ indices) +! 2. Gathers to PSB_ls_SPARSE_MAT (i.e. to matrix with PSB_LPK_ indices) ! ! Note: this function uses MPI_ALLGATHERV. At this time, the size of the ! resulting matrix must be within the range of 4 bytes because of the @@ -49,11 +49,11 @@ subroutine psb_ssp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keep use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_sspmat_type), intent(inout) :: loca @@ -233,11 +233,11 @@ subroutine psb_lssp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,kee use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_sspmat_type), intent(inout) :: loca @@ -406,11 +406,11 @@ subroutine psb_lslssp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,k use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_lsspmat_type), intent(inout) :: loca diff --git a/base/comm/psb_zscatter_a.F90 b/base/comm/psb_zscatter_a.F90 index aaa684b6..13eb22fe 100644 --- a/base/comm/psb_zscatter_a.F90 +++ b/base/comm/psb_zscatter_a.F90 @@ -46,11 +46,11 @@ subroutine psb_zscatterm(globx, locx, desc_a, info, root) use psb_base_mod, psb_protect_name => psb_zscatterm -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -162,8 +162,8 @@ subroutine psb_zscatterm(globx, locx, desc_a, info, root) rootrank = psb_get_mpi_rank(ctxt,iroot) ! - ! This is potentially unsafe when IPK=8 - ! But then, IPK=8 is highly experimental anyway. + ! This is potentially unsafe when PSB_IPK=8 + ! But then, PSB_IPK=8 is highly experimental anyway. ! nlr = nrow call mpi_gather(nlr,1,psb_mpi_mpk_,all_dim,& @@ -291,11 +291,11 @@ end subroutine psb_zscatterm ! subroutine psb_zscatterv(globx, locx, desc_a, info, root) use psb_base_mod, psb_protect_name => psb_zscatterv -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -398,8 +398,8 @@ subroutine psb_zscatterv(globx, locx, desc_a, info, root) else rootrank = psb_get_mpi_rank(ctxt,iroot) ! - ! This is potentially unsafe when IPK=8 - ! But then, IPK=8 is highly experimental anyway. + ! This is potentially unsafe when PSB_IPK=8 + ! But then, PSB_IPK=8 is highly experimental anyway. ! nlr = nrow call mpi_gather(nlr,1,psb_mpi_mpk_,all_dim,& diff --git a/base/comm/psb_zspgather.F90 b/base/comm/psb_zspgather.F90 index 2190b5cc..1630f904 100644 --- a/base/comm/psb_zspgather.F90 +++ b/base/comm/psb_zspgather.F90 @@ -33,8 +33,8 @@ ! ! Gathers a sparse matrix onto a single process. ! Two variants: -! 1. Gathers to PSB_z_SPARSE_MAT (i.e. to matrix with IPK_ indices) -! 2. Gathers to PSB_lz_SPARSE_MAT (i.e. to matrix with LPK_ indices) +! 1. Gathers to PSB_z_SPARSE_MAT (i.e. to matrix with PSB_IPK_ indices) +! 2. Gathers to PSB_lz_SPARSE_MAT (i.e. to matrix with PSB_LPK_ indices) ! ! Note: this function uses MPI_ALLGATHERV. At this time, the size of the ! resulting matrix must be within the range of 4 bytes because of the @@ -49,11 +49,11 @@ subroutine psb_zsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keep use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_zspmat_type), intent(inout) :: loca @@ -233,11 +233,11 @@ subroutine psb_lzsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,kee use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_zspmat_type), intent(inout) :: loca @@ -406,11 +406,11 @@ subroutine psb_lzlzsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,k use psb_mat_mod use psb_tools_mod use iso_c_binding -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_lzspmat_type), intent(inout) :: loca diff --git a/base/internals/psi_a2a_fnd_owner.F90 b/base/internals/psi_a2a_fnd_owner.F90 index edc160d0..9c7a2e65 100644 --- a/base/internals/psi_a2a_fnd_owner.F90 +++ b/base/internals/psi_a2a_fnd_owner.F90 @@ -55,12 +55,12 @@ subroutine psi_a2a_fnd_owner(idx,iprc,idxmap,info,samesize) use psb_penv_mod use psb_realloc_mod use psb_indx_map_mod, psb_protect_name => psi_a2a_fnd_owner -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_lpk_), intent(in) :: idx(:) @@ -138,7 +138,7 @@ subroutine psi_a2a_fnd_owner(idx,iprc,idxmap,info,samesize) call psb_errpush(psb_err_from_subroutine_,name,a_err='Allocate') goto 9999 end if -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) iprc(:) = 0 #else call mpi_allgather(idx,nv,psb_mpi_lpk_,rmtidx,nv,psb_mpi_lpk_,icomm,minfo) diff --git a/base/internals/psi_adjcncy_fnd_owner.F90 b/base/internals/psi_adjcncy_fnd_owner.F90 index 83e18623..dacc4e68 100644 --- a/base/internals/psi_adjcncy_fnd_owner.F90 +++ b/base/internals/psi_adjcncy_fnd_owner.F90 @@ -61,12 +61,12 @@ subroutine psi_adjcncy_fnd_owner(idx,iprc,adj,idxmap,info) use psb_realloc_mod use psb_timers_mod use psb_indx_map_mod, psb_protect_name => psi_adjcncy_fnd_owner -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_lpk_), intent(in) :: idx(:) @@ -139,7 +139,7 @@ subroutine psi_adjcncy_fnd_owner(idx,iprc,adj,idxmap,info) call psb_errpush(psb_err_from_subroutine_,name,a_err='psb_realloc') goto 9999 end if -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) iprc(:) = 0 #else iprc = -1 diff --git a/base/internals/psi_bld_glb_dep_list.F90 b/base/internals/psi_bld_glb_dep_list.F90 index f43e5f17..70a7159e 100644 --- a/base/internals/psi_bld_glb_dep_list.F90 +++ b/base/internals/psi_bld_glb_dep_list.F90 @@ -31,7 +31,7 @@ ! subroutine psi_i_bld_glb_dep_list(ctxt,loc_dl,length_dl,c_dep_list,dl_ptr,info) use psi_mod, psb_protect_name => psi_i_bld_glb_dep_list -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif use psb_penv_mod @@ -40,7 +40,7 @@ subroutine psi_i_bld_glb_dep_list(ctxt,loc_dl,length_dl,c_dep_list,dl_ptr,info) use psb_desc_mod use psb_sort_mod implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif ! ....scalar parameters... diff --git a/base/internals/psi_desc_index.F90 b/base/internals/psi_desc_index.F90 index 6423c116..5266bc5b 100644 --- a/base/internals/psi_desc_index.F90 +++ b/base/internals/psi_desc_index.F90 @@ -101,14 +101,14 @@ subroutine psi_i_desc_index(desc,index_in,dep_list,& use psb_realloc_mod use psb_error_mod use psb_const_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif use psb_penv_mod use psb_timers_mod use psi_mod, psb_protect_name => psi_i_desc_index implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/internals/psi_fnd_owner.F90 b/base/internals/psi_fnd_owner.F90 index 7f111a03..f19b4b1f 100644 --- a/base/internals/psi_fnd_owner.F90 +++ b/base/internals/psi_fnd_owner.F90 @@ -54,12 +54,12 @@ subroutine psi_fnd_owner(nv,idx,iprc,desc,info) use psb_penv_mod use psb_realloc_mod use psi_mod, psb_protect_name => psi_fnd_owner -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_ipk_), intent(in) :: nv diff --git a/base/internals/psi_graph_fnd_owner.F90 b/base/internals/psi_graph_fnd_owner.F90 index e5eed8c6..9d320cc3 100644 --- a/base/internals/psi_graph_fnd_owner.F90 +++ b/base/internals/psi_graph_fnd_owner.F90 @@ -86,12 +86,12 @@ subroutine psi_graph_fnd_owner(idx,iprc,ladj,idxmap,info) use psb_realloc_mod use psb_timers_mod use psb_desc_mod, psb_protect_name => psi_graph_fnd_owner -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_lpk_), intent(in) :: idx(:) @@ -152,7 +152,7 @@ subroutine psi_graph_fnd_owner(idx,iprc,ladj,idxmap,info) ! nv = size(idx) call psb_realloc(nv,iprc,info) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) iprc(:) = 0 #else if (info == psb_success_) call psb_realloc(nv,tidx,info) @@ -291,7 +291,7 @@ subroutine psi_graph_fnd_owner(idx,iprc,ladj,idxmap,info) 9999 call psb_error_handler(ctxt,err_act) return -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) contains diff --git a/base/internals/psi_indx_map_fnd_owner.F90 b/base/internals/psi_indx_map_fnd_owner.F90 index 157b73a1..30777cdf 100644 --- a/base/internals/psi_indx_map_fnd_owner.F90 +++ b/base/internals/psi_indx_map_fnd_owner.F90 @@ -58,12 +58,12 @@ subroutine psi_indx_map_fnd_owner(idx,iprc,idxmap,info,adj) use psb_penv_mod use psb_realloc_mod use psb_indx_map_mod, psb_protect_name => psi_indx_map_fnd_owner -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_lpk_), intent(in) :: idx(:) diff --git a/base/internals/psi_symm_dep_list.F90 b/base/internals/psi_symm_dep_list.F90 index 728ee832..f88eda91 100644 --- a/base/internals/psi_symm_dep_list.F90 +++ b/base/internals/psi_symm_dep_list.F90 @@ -44,12 +44,12 @@ subroutine psi_symm_dep_list_inrv(rvsz,adj,ctxt,info) use psb_penv_mod use psb_realloc_mod use psb_indx_map_mod, psb_protect_name => psi_symm_dep_list_inrv -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_mpk_), intent(inout) :: rvsz(0:) @@ -123,12 +123,12 @@ subroutine psi_symm_dep_list_norv(adj,ctxt,info) use psb_penv_mod use psb_realloc_mod use psb_indx_map_mod, psb_protect_name => psi_symm_dep_list_norv -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_ipk_), allocatable, intent(inout) :: adj(:) diff --git a/base/internals/psi_xtr_loc_dl.F90 b/base/internals/psi_xtr_loc_dl.F90 index c920ade1..8b22a0ca 100644 --- a/base/internals/psi_xtr_loc_dl.F90 +++ b/base/internals/psi_xtr_loc_dl.F90 @@ -109,7 +109,7 @@ subroutine psi_i_xtr_loc_dl(ctxt,is_bld,is_upd,desc_str,loc_dl,length_dl,info) ! dependence list of current process ! use psi_mod, psb_protect_name => psi_i_xtr_loc_dl -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif use psb_penv_mod @@ -118,7 +118,7 @@ subroutine psi_i_xtr_loc_dl(ctxt,is_bld,is_upd,desc_str,loc_dl,length_dl,info) use psb_desc_mod use psb_sort_mod implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif ! ....scalar parameters... diff --git a/base/modules/auxil/psb_c_realloc_mod.F90 b/base/modules/auxil/psb_c_realloc_mod.F90 index 9b22bee7..16be3183 100644 --- a/base/modules/auxil/psb_c_realloc_mod.F90 +++ b/base/modules/auxil/psb_c_realloc_mod.F90 @@ -154,30 +154,32 @@ Contains end if ub_ = lb_ + len-1 +#if defined(PSB_OPENMP) + !$omp critical(r_m_c_rk1) +#endif if (allocated(rrax)) then dim = size(rrax) lbi = lbound(rrax,1) If ((dim /= len).or.(lbi /= lb_)) Then Allocate(tmp(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & - & a_err='complex(psb_spk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 Allocate(rrax(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & - & a_err='complex(psb_spk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_m_c_rk1) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & + & a_err='complex(psb_spk_)') + goto 9999 + end if if (present(pad)) then !$omp parallel do private(i) shared(dim,len) do i=lb_-1+dim+1,lb_-1+len @@ -239,7 +241,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_m_c_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -248,27 +252,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & - & a_err='complex(psb_spk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & - & a_err='complex(psb_spk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_m_c_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & + & a_err='complex(psb_spk_)') + goto 9999 + end if if (present(pad)) then !$omp parallel do private(i) shared(lb1_,dim,len1) do i=lb1_-1+dim+1,lb1_-1+len1 @@ -325,30 +328,33 @@ Contains end if ub_ = lb_ + len-1 +#if defined(PSB_OPENMP) + !$omp critical(r_e_c_rk1) +#endif if (allocated(rrax)) then dim = size(rrax) lbi = lbound(rrax,1) If ((dim /= len).or.(lbi /= lb_)) Then Allocate(tmp(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len/), & - & a_err='complex(psb_spk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 Allocate(rrax(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len/), & - & a_err='complex(psb_spk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_e_c_rk1) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len/), & + & a_err='complex(psb_spk_)') + goto 9999 + end if + if (present(pad)) then rrax(lb_-1+dim+1:lb_-1+len) = pad endif @@ -407,7 +413,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_e_c_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -416,27 +424,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/(len1*len2)/), & - & a_err='complex(psb_spk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/(len1*len2)/), & - & a_err='complex(psb_spk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_e_c_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/(len1*len2)/), & + & a_err='complex(psb_spk_)') + goto 9999 + end if if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -498,7 +505,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_me_c_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -507,27 +516,28 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='complex(psb_spk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name,e_err=(/len1*len2/),& - & a_err='complex(psb_spk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_me_c_rk2) +#endif + + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len1*len2/), & + & a_err='complex(psb_spk_)') + goto 9999 + end if + if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -589,7 +599,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_em_c_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -598,27 +610,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='complex(psb_spk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='complex(psb_spk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_em_c_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len1*len2/), & + & a_err='complex(psb_spk_)') + goto 9999 + end if if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -715,8 +726,6 @@ Contains End Subroutine psb_r_e_2_c_rk1 - - subroutine psb_ab_cpy_c_s(vin,vout,info) use psb_error_mod @@ -999,8 +1008,9 @@ Contains isz = psb_size(v) If (len > isz) Then -#if defined(OPENMP) - !$OMP CRITICAL +#if defined(PSB_OPENMP) + !$omp critical(m_sz_c_rk1) + isz = psb_size(v) if (len > isz) then if (present(newsz)) then isz = max(len+1,1,newsz) @@ -1012,7 +1022,9 @@ Contains call psb_realloc(isz,v,info,pad=pad) end if - !$OMP END CRITICAL + if (info /= psb_success_) & + & write(0,*) 'Error from realloc ',info,len,isz + !$omp end critical(m_sz_c_rk1) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -1028,7 +1040,6 @@ Contains else isz = max(len,1,int(1.25*isz)) endif - call psb_realloc(isz,v,info,pad=pad) end if @@ -1075,6 +1086,28 @@ Contains end if isz = psb_size(v) If (len > isz) Then +#if defined(PSB_OPENMP) + !$omp critical(e_sz_c_rk1) + isz = psb_size(v) + If (len > isz) Then + if (present(newsz)) then + isz = max(len+1,1,newsz) + else if (present(addsz)) then + isz = max(len,1,isz+addsz) + else + isz = max(len,1,int(1.25*isz)) + endif + call psb_realloc(isz,v,info,pad=pad) + end If + if (info /= psb_success_)& + & write(0,*) 'Error from realloc ',info,len,isz + !$omp end critical(e_sz_c_rk1) + if (info /= psb_success_) then + info=psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='psb_realloc') + goto 9999 + End If +#else if (present(newsz)) then isz = max(len+1,1,newsz) else if (present(addsz)) then @@ -1082,13 +1115,13 @@ Contains else isz = max(len,1,int(1.25*isz)) endif - call psb_realloc(isz,v,info,pad=pad) if (info /= psb_success_) then info=psb_err_from_subroutine_ call psb_errpush(info,name,a_err='psb_realloc') goto 9999 End If +#endif end If call psb_erractionrestore(err_act) diff --git a/base/modules/auxil/psb_d_realloc_mod.F90 b/base/modules/auxil/psb_d_realloc_mod.F90 index ca85e0ec..ae093a4a 100644 --- a/base/modules/auxil/psb_d_realloc_mod.F90 +++ b/base/modules/auxil/psb_d_realloc_mod.F90 @@ -154,30 +154,32 @@ Contains end if ub_ = lb_ + len-1 +#if defined(PSB_OPENMP) + !$omp critical(r_m_d_rk1) +#endif if (allocated(rrax)) then dim = size(rrax) lbi = lbound(rrax,1) If ((dim /= len).or.(lbi /= lb_)) Then Allocate(tmp(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & - & a_err='real(psb_dpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 Allocate(rrax(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & - & a_err='real(psb_dpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_m_d_rk1) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & + & a_err='real(psb_dpk_)') + goto 9999 + end if if (present(pad)) then !$omp parallel do private(i) shared(dim,len) do i=lb_-1+dim+1,lb_-1+len @@ -239,7 +241,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_m_d_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -248,27 +252,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & - & a_err='real(psb_dpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & - & a_err='real(psb_dpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_m_d_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & + & a_err='real(psb_dpk_)') + goto 9999 + end if if (present(pad)) then !$omp parallel do private(i) shared(lb1_,dim,len1) do i=lb1_-1+dim+1,lb1_-1+len1 @@ -325,30 +328,33 @@ Contains end if ub_ = lb_ + len-1 +#if defined(PSB_OPENMP) + !$omp critical(r_e_d_rk1) +#endif if (allocated(rrax)) then dim = size(rrax) lbi = lbound(rrax,1) If ((dim /= len).or.(lbi /= lb_)) Then Allocate(tmp(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len/), & - & a_err='real(psb_dpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 Allocate(rrax(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len/), & - & a_err='real(psb_dpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_e_d_rk1) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len/), & + & a_err='real(psb_dpk_)') + goto 9999 + end if + if (present(pad)) then rrax(lb_-1+dim+1:lb_-1+len) = pad endif @@ -407,7 +413,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_e_d_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -416,27 +424,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/(len1*len2)/), & - & a_err='real(psb_dpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/(len1*len2)/), & - & a_err='real(psb_dpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_e_d_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/(len1*len2)/), & + & a_err='real(psb_dpk_)') + goto 9999 + end if if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -498,7 +505,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_me_d_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -507,27 +516,28 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='real(psb_dpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name,e_err=(/len1*len2/),& - & a_err='real(psb_dpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_me_d_rk2) +#endif + + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len1*len2/), & + & a_err='real(psb_dpk_)') + goto 9999 + end if + if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -589,7 +599,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_em_d_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -598,27 +610,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='real(psb_dpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='real(psb_dpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_em_d_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len1*len2/), & + & a_err='real(psb_dpk_)') + goto 9999 + end if if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -715,8 +726,6 @@ Contains End Subroutine psb_r_e_2_d_rk1 - - subroutine psb_ab_cpy_d_s(vin,vout,info) use psb_error_mod @@ -999,8 +1008,9 @@ Contains isz = psb_size(v) If (len > isz) Then -#if defined(OPENMP) - !$OMP CRITICAL +#if defined(PSB_OPENMP) + !$omp critical(m_sz_d_rk1) + isz = psb_size(v) if (len > isz) then if (present(newsz)) then isz = max(len+1,1,newsz) @@ -1012,7 +1022,9 @@ Contains call psb_realloc(isz,v,info,pad=pad) end if - !$OMP END CRITICAL + if (info /= psb_success_) & + & write(0,*) 'Error from realloc ',info,len,isz + !$omp end critical(m_sz_d_rk1) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -1028,7 +1040,6 @@ Contains else isz = max(len,1,int(1.25*isz)) endif - call psb_realloc(isz,v,info,pad=pad) end if @@ -1075,6 +1086,28 @@ Contains end if isz = psb_size(v) If (len > isz) Then +#if defined(PSB_OPENMP) + !$omp critical(e_sz_d_rk1) + isz = psb_size(v) + If (len > isz) Then + if (present(newsz)) then + isz = max(len+1,1,newsz) + else if (present(addsz)) then + isz = max(len,1,isz+addsz) + else + isz = max(len,1,int(1.25*isz)) + endif + call psb_realloc(isz,v,info,pad=pad) + end If + if (info /= psb_success_)& + & write(0,*) 'Error from realloc ',info,len,isz + !$omp end critical(e_sz_d_rk1) + if (info /= psb_success_) then + info=psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='psb_realloc') + goto 9999 + End If +#else if (present(newsz)) then isz = max(len+1,1,newsz) else if (present(addsz)) then @@ -1082,13 +1115,13 @@ Contains else isz = max(len,1,int(1.25*isz)) endif - call psb_realloc(isz,v,info,pad=pad) if (info /= psb_success_) then info=psb_err_from_subroutine_ call psb_errpush(info,name,a_err='psb_realloc') goto 9999 End If +#endif end If call psb_erractionrestore(err_act) diff --git a/base/modules/auxil/psb_e_realloc_mod.F90 b/base/modules/auxil/psb_e_realloc_mod.F90 index 06a6d034..688753d8 100644 --- a/base/modules/auxil/psb_e_realloc_mod.F90 +++ b/base/modules/auxil/psb_e_realloc_mod.F90 @@ -154,30 +154,32 @@ Contains end if ub_ = lb_ + len-1 +#if defined(PSB_OPENMP) + !$omp critical(r_m_e_rk1) +#endif if (allocated(rrax)) then dim = size(rrax) lbi = lbound(rrax,1) If ((dim /= len).or.(lbi /= lb_)) Then Allocate(tmp(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & - & a_err='integer(psb_epk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 Allocate(rrax(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & - & a_err='integer(psb_epk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_m_e_rk1) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & + & a_err='integer(psb_epk_)') + goto 9999 + end if if (present(pad)) then !$omp parallel do private(i) shared(dim,len) do i=lb_-1+dim+1,lb_-1+len @@ -239,7 +241,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_m_e_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -248,27 +252,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & - & a_err='integer(psb_epk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & - & a_err='integer(psb_epk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_m_e_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & + & a_err='integer(psb_epk_)') + goto 9999 + end if if (present(pad)) then !$omp parallel do private(i) shared(lb1_,dim,len1) do i=lb1_-1+dim+1,lb1_-1+len1 @@ -325,30 +328,33 @@ Contains end if ub_ = lb_ + len-1 +#if defined(PSB_OPENMP) + !$omp critical(r_e_e_rk1) +#endif if (allocated(rrax)) then dim = size(rrax) lbi = lbound(rrax,1) If ((dim /= len).or.(lbi /= lb_)) Then Allocate(tmp(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len/), & - & a_err='integer(psb_epk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 Allocate(rrax(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len/), & - & a_err='integer(psb_epk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_e_e_rk1) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len/), & + & a_err='integer(psb_epk_)') + goto 9999 + end if + if (present(pad)) then rrax(lb_-1+dim+1:lb_-1+len) = pad endif @@ -407,7 +413,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_e_e_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -416,27 +424,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/(len1*len2)/), & - & a_err='integer(psb_epk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/(len1*len2)/), & - & a_err='integer(psb_epk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_e_e_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/(len1*len2)/), & + & a_err='integer(psb_epk_)') + goto 9999 + end if if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -498,7 +505,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_me_e_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -507,27 +516,28 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='integer(psb_epk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name,e_err=(/len1*len2/),& - & a_err='integer(psb_epk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_me_e_rk2) +#endif + + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len1*len2/), & + & a_err='integer(psb_epk_)') + goto 9999 + end if + if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -589,7 +599,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_em_e_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -598,27 +610,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='integer(psb_epk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='integer(psb_epk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_em_e_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len1*len2/), & + & a_err='integer(psb_epk_)') + goto 9999 + end if if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -715,8 +726,6 @@ Contains End Subroutine psb_r_e_2_e_rk1 - - subroutine psb_ab_cpy_e_s(vin,vout,info) use psb_error_mod @@ -999,8 +1008,9 @@ Contains isz = psb_size(v) If (len > isz) Then -#if defined(OPENMP) - !$OMP CRITICAL +#if defined(PSB_OPENMP) + !$omp critical(m_sz_e_rk1) + isz = psb_size(v) if (len > isz) then if (present(newsz)) then isz = max(len+1,1,newsz) @@ -1012,7 +1022,9 @@ Contains call psb_realloc(isz,v,info,pad=pad) end if - !$OMP END CRITICAL + if (info /= psb_success_) & + & write(0,*) 'Error from realloc ',info,len,isz + !$omp end critical(m_sz_e_rk1) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -1028,7 +1040,6 @@ Contains else isz = max(len,1,int(1.25*isz)) endif - call psb_realloc(isz,v,info,pad=pad) end if @@ -1075,6 +1086,28 @@ Contains end if isz = psb_size(v) If (len > isz) Then +#if defined(PSB_OPENMP) + !$omp critical(e_sz_e_rk1) + isz = psb_size(v) + If (len > isz) Then + if (present(newsz)) then + isz = max(len+1,1,newsz) + else if (present(addsz)) then + isz = max(len,1,isz+addsz) + else + isz = max(len,1,int(1.25*isz)) + endif + call psb_realloc(isz,v,info,pad=pad) + end If + if (info /= psb_success_)& + & write(0,*) 'Error from realloc ',info,len,isz + !$omp end critical(e_sz_e_rk1) + if (info /= psb_success_) then + info=psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='psb_realloc') + goto 9999 + End If +#else if (present(newsz)) then isz = max(len+1,1,newsz) else if (present(addsz)) then @@ -1082,13 +1115,13 @@ Contains else isz = max(len,1,int(1.25*isz)) endif - call psb_realloc(isz,v,info,pad=pad) if (info /= psb_success_) then info=psb_err_from_subroutine_ call psb_errpush(info,name,a_err='psb_realloc') goto 9999 End If +#endif end If call psb_erractionrestore(err_act) diff --git a/base/modules/auxil/psb_i2_realloc_mod.F90 b/base/modules/auxil/psb_i2_realloc_mod.F90 index 146bdf7e..8d14f563 100644 --- a/base/modules/auxil/psb_i2_realloc_mod.F90 +++ b/base/modules/auxil/psb_i2_realloc_mod.F90 @@ -154,30 +154,32 @@ Contains end if ub_ = lb_ + len-1 +#if defined(PSB_OPENMP) + !$omp critical(r_m_i2_rk1) +#endif if (allocated(rrax)) then dim = size(rrax) lbi = lbound(rrax,1) If ((dim /= len).or.(lbi /= lb_)) Then Allocate(tmp(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & - & a_err='integer(psb_i2pk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 Allocate(rrax(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & - & a_err='integer(psb_i2pk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_m_i2_rk1) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & + & a_err='integer(psb_i2pk_)') + goto 9999 + end if if (present(pad)) then !$omp parallel do private(i) shared(dim,len) do i=lb_-1+dim+1,lb_-1+len @@ -239,7 +241,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_m_i2_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -248,27 +252,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & - & a_err='integer(psb_i2pk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & - & a_err='integer(psb_i2pk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_m_i2_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & + & a_err='integer(psb_i2pk_)') + goto 9999 + end if if (present(pad)) then !$omp parallel do private(i) shared(lb1_,dim,len1) do i=lb1_-1+dim+1,lb1_-1+len1 @@ -325,30 +328,33 @@ Contains end if ub_ = lb_ + len-1 +#if defined(PSB_OPENMP) + !$omp critical(r_e_i2_rk1) +#endif if (allocated(rrax)) then dim = size(rrax) lbi = lbound(rrax,1) If ((dim /= len).or.(lbi /= lb_)) Then Allocate(tmp(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len/), & - & a_err='integer(psb_i2pk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 Allocate(rrax(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len/), & - & a_err='integer(psb_i2pk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_e_i2_rk1) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len/), & + & a_err='integer(psb_i2pk_)') + goto 9999 + end if + if (present(pad)) then rrax(lb_-1+dim+1:lb_-1+len) = pad endif @@ -407,7 +413,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_e_i2_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -416,27 +424,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/(len1*len2)/), & - & a_err='integer(psb_i2pk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/(len1*len2)/), & - & a_err='integer(psb_i2pk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_e_i2_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/(len1*len2)/), & + & a_err='integer(psb_i2pk_)') + goto 9999 + end if if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -498,7 +505,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_me_i2_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -507,27 +516,28 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='integer(psb_i2pk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name,e_err=(/len1*len2/),& - & a_err='integer(psb_i2pk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_me_i2_rk2) +#endif + + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len1*len2/), & + & a_err='integer(psb_i2pk_)') + goto 9999 + end if + if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -589,7 +599,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_em_i2_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -598,27 +610,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='integer(psb_i2pk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='integer(psb_i2pk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_em_i2_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len1*len2/), & + & a_err='integer(psb_i2pk_)') + goto 9999 + end if if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -715,8 +726,6 @@ Contains End Subroutine psb_r_e_2_i2_rk1 - - subroutine psb_ab_cpy_i2_s(vin,vout,info) use psb_error_mod @@ -999,8 +1008,9 @@ Contains isz = psb_size(v) If (len > isz) Then -#if defined(OPENMP) - !$OMP CRITICAL +#if defined(PSB_OPENMP) + !$omp critical(m_sz_i2_rk1) + isz = psb_size(v) if (len > isz) then if (present(newsz)) then isz = max(len+1,1,newsz) @@ -1012,7 +1022,9 @@ Contains call psb_realloc(isz,v,info,pad=pad) end if - !$OMP END CRITICAL + if (info /= psb_success_) & + & write(0,*) 'Error from realloc ',info,len,isz + !$omp end critical(m_sz_i2_rk1) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -1028,7 +1040,6 @@ Contains else isz = max(len,1,int(1.25*isz)) endif - call psb_realloc(isz,v,info,pad=pad) end if @@ -1075,6 +1086,28 @@ Contains end if isz = psb_size(v) If (len > isz) Then +#if defined(PSB_OPENMP) + !$omp critical(e_sz_i2_rk1) + isz = psb_size(v) + If (len > isz) Then + if (present(newsz)) then + isz = max(len+1,1,newsz) + else if (present(addsz)) then + isz = max(len,1,isz+addsz) + else + isz = max(len,1,int(1.25*isz)) + endif + call psb_realloc(isz,v,info,pad=pad) + end If + if (info /= psb_success_)& + & write(0,*) 'Error from realloc ',info,len,isz + !$omp end critical(e_sz_i2_rk1) + if (info /= psb_success_) then + info=psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='psb_realloc') + goto 9999 + End If +#else if (present(newsz)) then isz = max(len+1,1,newsz) else if (present(addsz)) then @@ -1082,13 +1115,13 @@ Contains else isz = max(len,1,int(1.25*isz)) endif - call psb_realloc(isz,v,info,pad=pad) if (info /= psb_success_) then info=psb_err_from_subroutine_ call psb_errpush(info,name,a_err='psb_realloc') goto 9999 End If +#endif end If call psb_erractionrestore(err_act) diff --git a/base/modules/auxil/psb_m_realloc_mod.F90 b/base/modules/auxil/psb_m_realloc_mod.F90 index 4d2f9316..865aa47b 100644 --- a/base/modules/auxil/psb_m_realloc_mod.F90 +++ b/base/modules/auxil/psb_m_realloc_mod.F90 @@ -154,30 +154,32 @@ Contains end if ub_ = lb_ + len-1 +#if defined(PSB_OPENMP) + !$omp critical(r_m_m_rk1) +#endif if (allocated(rrax)) then dim = size(rrax) lbi = lbound(rrax,1) If ((dim /= len).or.(lbi /= lb_)) Then Allocate(tmp(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & - & a_err='integer(psb_mpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 Allocate(rrax(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & - & a_err='integer(psb_mpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_m_m_rk1) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & + & a_err='integer(psb_mpk_)') + goto 9999 + end if if (present(pad)) then !$omp parallel do private(i) shared(dim,len) do i=lb_-1+dim+1,lb_-1+len @@ -239,7 +241,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_m_m_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -248,27 +252,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & - & a_err='integer(psb_mpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & - & a_err='integer(psb_mpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_m_m_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & + & a_err='integer(psb_mpk_)') + goto 9999 + end if if (present(pad)) then !$omp parallel do private(i) shared(lb1_,dim,len1) do i=lb1_-1+dim+1,lb1_-1+len1 @@ -325,30 +328,33 @@ Contains end if ub_ = lb_ + len-1 +#if defined(PSB_OPENMP) + !$omp critical(r_e_m_rk1) +#endif if (allocated(rrax)) then dim = size(rrax) lbi = lbound(rrax,1) If ((dim /= len).or.(lbi /= lb_)) Then Allocate(tmp(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len/), & - & a_err='integer(psb_mpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 Allocate(rrax(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len/), & - & a_err='integer(psb_mpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_e_m_rk1) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len/), & + & a_err='integer(psb_mpk_)') + goto 9999 + end if + if (present(pad)) then rrax(lb_-1+dim+1:lb_-1+len) = pad endif @@ -407,7 +413,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_e_m_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -416,27 +424,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/(len1*len2)/), & - & a_err='integer(psb_mpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/(len1*len2)/), & - & a_err='integer(psb_mpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_e_m_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/(len1*len2)/), & + & a_err='integer(psb_mpk_)') + goto 9999 + end if if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -498,7 +505,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_me_m_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -507,27 +516,28 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='integer(psb_mpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name,e_err=(/len1*len2/),& - & a_err='integer(psb_mpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_me_m_rk2) +#endif + + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len1*len2/), & + & a_err='integer(psb_mpk_)') + goto 9999 + end if + if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -589,7 +599,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_em_m_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -598,27 +610,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='integer(psb_mpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='integer(psb_mpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_em_m_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len1*len2/), & + & a_err='integer(psb_mpk_)') + goto 9999 + end if if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -715,8 +726,6 @@ Contains End Subroutine psb_r_e_2_m_rk1 - - subroutine psb_ab_cpy_m_s(vin,vout,info) use psb_error_mod @@ -999,8 +1008,9 @@ Contains isz = psb_size(v) If (len > isz) Then -#if defined(OPENMP) - !$OMP CRITICAL +#if defined(PSB_OPENMP) + !$omp critical(m_sz_m_rk1) + isz = psb_size(v) if (len > isz) then if (present(newsz)) then isz = max(len+1,1,newsz) @@ -1012,7 +1022,9 @@ Contains call psb_realloc(isz,v,info,pad=pad) end if - !$OMP END CRITICAL + if (info /= psb_success_) & + & write(0,*) 'Error from realloc ',info,len,isz + !$omp end critical(m_sz_m_rk1) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -1028,7 +1040,6 @@ Contains else isz = max(len,1,int(1.25*isz)) endif - call psb_realloc(isz,v,info,pad=pad) end if @@ -1075,6 +1086,28 @@ Contains end if isz = psb_size(v) If (len > isz) Then +#if defined(PSB_OPENMP) + !$omp critical(e_sz_m_rk1) + isz = psb_size(v) + If (len > isz) Then + if (present(newsz)) then + isz = max(len+1,1,newsz) + else if (present(addsz)) then + isz = max(len,1,isz+addsz) + else + isz = max(len,1,int(1.25*isz)) + endif + call psb_realloc(isz,v,info,pad=pad) + end If + if (info /= psb_success_)& + & write(0,*) 'Error from realloc ',info,len,isz + !$omp end critical(e_sz_m_rk1) + if (info /= psb_success_) then + info=psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='psb_realloc') + goto 9999 + End If +#else if (present(newsz)) then isz = max(len+1,1,newsz) else if (present(addsz)) then @@ -1082,13 +1115,13 @@ Contains else isz = max(len,1,int(1.25*isz)) endif - call psb_realloc(isz,v,info,pad=pad) if (info /= psb_success_) then info=psb_err_from_subroutine_ call psb_errpush(info,name,a_err='psb_realloc') goto 9999 End If +#endif end If call psb_erractionrestore(err_act) diff --git a/base/modules/auxil/psb_s_realloc_mod.F90 b/base/modules/auxil/psb_s_realloc_mod.F90 index f064e606..fb2820cc 100644 --- a/base/modules/auxil/psb_s_realloc_mod.F90 +++ b/base/modules/auxil/psb_s_realloc_mod.F90 @@ -154,30 +154,32 @@ Contains end if ub_ = lb_ + len-1 +#if defined(PSB_OPENMP) + !$omp critical(r_m_s_rk1) +#endif if (allocated(rrax)) then dim = size(rrax) lbi = lbound(rrax,1) If ((dim /= len).or.(lbi /= lb_)) Then Allocate(tmp(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & - & a_err='real(psb_spk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 Allocate(rrax(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & - & a_err='real(psb_spk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_m_s_rk1) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & + & a_err='real(psb_spk_)') + goto 9999 + end if if (present(pad)) then !$omp parallel do private(i) shared(dim,len) do i=lb_-1+dim+1,lb_-1+len @@ -239,7 +241,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_m_s_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -248,27 +252,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & - & a_err='real(psb_spk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & - & a_err='real(psb_spk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_m_s_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & + & a_err='real(psb_spk_)') + goto 9999 + end if if (present(pad)) then !$omp parallel do private(i) shared(lb1_,dim,len1) do i=lb1_-1+dim+1,lb1_-1+len1 @@ -325,30 +328,33 @@ Contains end if ub_ = lb_ + len-1 +#if defined(PSB_OPENMP) + !$omp critical(r_e_s_rk1) +#endif if (allocated(rrax)) then dim = size(rrax) lbi = lbound(rrax,1) If ((dim /= len).or.(lbi /= lb_)) Then Allocate(tmp(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len/), & - & a_err='real(psb_spk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 Allocate(rrax(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len/), & - & a_err='real(psb_spk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_e_s_rk1) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len/), & + & a_err='real(psb_spk_)') + goto 9999 + end if + if (present(pad)) then rrax(lb_-1+dim+1:lb_-1+len) = pad endif @@ -407,7 +413,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_e_s_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -416,27 +424,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/(len1*len2)/), & - & a_err='real(psb_spk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/(len1*len2)/), & - & a_err='real(psb_spk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_e_s_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/(len1*len2)/), & + & a_err='real(psb_spk_)') + goto 9999 + end if if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -498,7 +505,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_me_s_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -507,27 +516,28 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='real(psb_spk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name,e_err=(/len1*len2/),& - & a_err='real(psb_spk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_me_s_rk2) +#endif + + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len1*len2/), & + & a_err='real(psb_spk_)') + goto 9999 + end if + if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -589,7 +599,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_em_s_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -598,27 +610,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='real(psb_spk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='real(psb_spk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_em_s_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len1*len2/), & + & a_err='real(psb_spk_)') + goto 9999 + end if if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -715,8 +726,6 @@ Contains End Subroutine psb_r_e_2_s_rk1 - - subroutine psb_ab_cpy_s_s(vin,vout,info) use psb_error_mod @@ -999,8 +1008,9 @@ Contains isz = psb_size(v) If (len > isz) Then -#if defined(OPENMP) - !$OMP CRITICAL +#if defined(PSB_OPENMP) + !$omp critical(m_sz_s_rk1) + isz = psb_size(v) if (len > isz) then if (present(newsz)) then isz = max(len+1,1,newsz) @@ -1012,7 +1022,9 @@ Contains call psb_realloc(isz,v,info,pad=pad) end if - !$OMP END CRITICAL + if (info /= psb_success_) & + & write(0,*) 'Error from realloc ',info,len,isz + !$omp end critical(m_sz_s_rk1) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -1028,7 +1040,6 @@ Contains else isz = max(len,1,int(1.25*isz)) endif - call psb_realloc(isz,v,info,pad=pad) end if @@ -1075,6 +1086,28 @@ Contains end if isz = psb_size(v) If (len > isz) Then +#if defined(PSB_OPENMP) + !$omp critical(e_sz_s_rk1) + isz = psb_size(v) + If (len > isz) Then + if (present(newsz)) then + isz = max(len+1,1,newsz) + else if (present(addsz)) then + isz = max(len,1,isz+addsz) + else + isz = max(len,1,int(1.25*isz)) + endif + call psb_realloc(isz,v,info,pad=pad) + end If + if (info /= psb_success_)& + & write(0,*) 'Error from realloc ',info,len,isz + !$omp end critical(e_sz_s_rk1) + if (info /= psb_success_) then + info=psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='psb_realloc') + goto 9999 + End If +#else if (present(newsz)) then isz = max(len+1,1,newsz) else if (present(addsz)) then @@ -1082,13 +1115,13 @@ Contains else isz = max(len,1,int(1.25*isz)) endif - call psb_realloc(isz,v,info,pad=pad) if (info /= psb_success_) then info=psb_err_from_subroutine_ call psb_errpush(info,name,a_err='psb_realloc') goto 9999 End If +#endif end If call psb_erractionrestore(err_act) diff --git a/base/modules/auxil/psb_z_realloc_mod.F90 b/base/modules/auxil/psb_z_realloc_mod.F90 index e9eb26d3..cf33e731 100644 --- a/base/modules/auxil/psb_z_realloc_mod.F90 +++ b/base/modules/auxil/psb_z_realloc_mod.F90 @@ -154,30 +154,32 @@ Contains end if ub_ = lb_ + len-1 +#if defined(PSB_OPENMP) + !$omp critical(r_m_z_rk1) +#endif if (allocated(rrax)) then dim = size(rrax) lbi = lbound(rrax,1) If ((dim /= len).or.(lbi /= lb_)) Then Allocate(tmp(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & - & a_err='complex(psb_dpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 Allocate(rrax(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & - & a_err='complex(psb_dpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_m_z_rk1) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, l_err=(/len*1_psb_lpk_/), & + & a_err='complex(psb_dpk_)') + goto 9999 + end if if (present(pad)) then !$omp parallel do private(i) shared(dim,len) do i=lb_-1+dim+1,lb_-1+len @@ -239,7 +241,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_m_z_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -248,27 +252,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & - & a_err='complex(psb_dpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & - & a_err='complex(psb_dpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_m_z_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, l_err=(/len1*1_psb_lpk_*len2/), & + & a_err='complex(psb_dpk_)') + goto 9999 + end if if (present(pad)) then !$omp parallel do private(i) shared(lb1_,dim,len1) do i=lb1_-1+dim+1,lb1_-1+len1 @@ -325,30 +328,33 @@ Contains end if ub_ = lb_ + len-1 +#if defined(PSB_OPENMP) + !$omp critical(r_e_z_rk1) +#endif if (allocated(rrax)) then dim = size(rrax) lbi = lbound(rrax,1) If ((dim /= len).or.(lbi /= lb_)) Then Allocate(tmp(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len/), & - & a_err='complex(psb_dpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb_:lb_-1+min(len,dim))=rrax(lbi:lbi-1+min(len,dim)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 Allocate(rrax(lb_:ub_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len/), & - & a_err='complex(psb_dpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_e_z_rk1) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len/), & + & a_err='complex(psb_dpk_)') + goto 9999 + end if + if (present(pad)) then rrax(lb_-1+dim+1:lb_-1+len) = pad endif @@ -407,7 +413,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_e_z_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -416,27 +424,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/(len1*len2)/), & - & a_err='complex(psb_dpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/(len1*len2)/), & - & a_err='complex(psb_dpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_e_z_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/(len1*len2)/), & + & a_err='complex(psb_dpk_)') + goto 9999 + end if if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -498,7 +505,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_me_z_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -507,27 +516,28 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='complex(psb_dpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name,e_err=(/len1*len2/),& - & a_err='complex(psb_dpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_me_z_rk2) +#endif + + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len1*len2/), & + & a_err='complex(psb_dpk_)') + goto 9999 + end if + if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -589,7 +599,9 @@ Contains goto 9999 end if - +#if defined(PSB_OPENMP) + !$omp critical(r_em_z_rk2) +#endif if (allocated(rrax)) then dim = size(rrax,1) lbi1 = lbound(rrax,1) @@ -598,27 +610,26 @@ Contains If ((dim /= len1).or.(dim2 /= len2).or.(lbi1 /= lb1_)& & .or.(lbi2 /= lb2_)) Then Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='complex(psb_dpk_)') - goto 9999 + if (info == psb_success_) then + tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & + & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) + call psb_move_alloc(tmp,rrax,info) end if - tmp(lb1_:lb1_-1+min(len1,dim),lb2_:lb2_-1+min(len2,dim2)) = & - & rrax(lbi1:lbi1-1+min(len1,dim),lbi2:lbi2-1+min(len2,dim2)) - call psb_move_alloc(tmp,rrax,info) End If else dim = 0 dim2 = 0 Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info) - if (info /= psb_success_) then - err=4025 - call psb_errpush(err,name, e_err=(/len1*len2/), & - & a_err='complex(psb_dpk_)') - goto 9999 - end if endif +#if defined(PSB_OPENMP) + !$omp end critical(r_em_z_rk2) +#endif + if (info /= psb_success_) then + err=4025 + call psb_errpush(err,name, e_err=(/len1*len2/), & + & a_err='complex(psb_dpk_)') + goto 9999 + end if if (present(pad)) then rrax(lb1_-1+dim+1:lb1_-1+len1,:) = pad rrax(lb1_:lb1_-1+dim,lb2_-1+dim2+1:lb2_-1+len2) = pad @@ -715,8 +726,6 @@ Contains End Subroutine psb_r_e_2_z_rk1 - - subroutine psb_ab_cpy_z_s(vin,vout,info) use psb_error_mod @@ -999,8 +1008,9 @@ Contains isz = psb_size(v) If (len > isz) Then -#if defined(OPENMP) - !$OMP CRITICAL +#if defined(PSB_OPENMP) + !$omp critical(m_sz_z_rk1) + isz = psb_size(v) if (len > isz) then if (present(newsz)) then isz = max(len+1,1,newsz) @@ -1012,7 +1022,9 @@ Contains call psb_realloc(isz,v,info,pad=pad) end if - !$OMP END CRITICAL + if (info /= psb_success_) & + & write(0,*) 'Error from realloc ',info,len,isz + !$omp end critical(m_sz_z_rk1) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -1028,7 +1040,6 @@ Contains else isz = max(len,1,int(1.25*isz)) endif - call psb_realloc(isz,v,info,pad=pad) end if @@ -1075,6 +1086,28 @@ Contains end if isz = psb_size(v) If (len > isz) Then +#if defined(PSB_OPENMP) + !$omp critical(e_sz_z_rk1) + isz = psb_size(v) + If (len > isz) Then + if (present(newsz)) then + isz = max(len+1,1,newsz) + else if (present(addsz)) then + isz = max(len,1,isz+addsz) + else + isz = max(len,1,int(1.25*isz)) + endif + call psb_realloc(isz,v,info,pad=pad) + end If + if (info /= psb_success_)& + & write(0,*) 'Error from realloc ',info,len,isz + !$omp end critical(e_sz_z_rk1) + if (info /= psb_success_) then + info=psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='psb_realloc') + goto 9999 + End If +#else if (present(newsz)) then isz = max(len+1,1,newsz) else if (present(addsz)) then @@ -1082,13 +1115,13 @@ Contains else isz = max(len,1,int(1.25*isz)) endif - call psb_realloc(isz,v,info,pad=pad) if (info /= psb_success_) then info=psb_err_from_subroutine_ call psb_errpush(info,name,a_err='psb_realloc') goto 9999 End If +#endif end If call psb_erractionrestore(err_act) diff --git a/base/modules/desc/psb_desc_mod.F90 b/base/modules/desc/psb_desc_mod.F90 index ad0bc74c..2ae1b1a5 100644 --- a/base/modules/desc/psb_desc_mod.F90 +++ b/base/modules/desc/psb_desc_mod.F90 @@ -289,7 +289,7 @@ module psb_desc_mod module procedure psb_i_cd_set_large_threshold end interface psb_cd_set_large_threshold -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) interface psb_cd_set_large_threshold module procedure psb_l_cd_set_large_threshold end interface psb_cd_set_large_threshold diff --git a/base/modules/desc/psb_gen_block_map_mod.F90 b/base/modules/desc/psb_gen_block_map_mod.F90 index 6fb86621..b52d4c59 100644 --- a/base/modules/desc/psb_gen_block_map_mod.F90 +++ b/base/modules/desc/psb_gen_block_map_mod.F90 @@ -109,13 +109,13 @@ module psb_gen_block_map_mod & block_lg2ls1_ins, block_lg2ls2_ins, block_lg2lv1_ins, block_lg2lv2_ins, & & block_clone, block_reinit,& & block_get_fmt, i_gen_block_search -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) private :: l_gen_block_search #endif interface gen_block_search module procedure i_gen_block_search -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) module procedure l_gen_block_search #endif end interface gen_block_search @@ -1382,7 +1382,7 @@ contains return end function i_gen_block_search -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) function l_gen_block_search(key,n,v) result(ipos) implicit none diff --git a/base/modules/desc/psb_hash_map_mod.F90 b/base/modules/desc/psb_hash_map_mod.F90 index d3acc491..9c1b40bc 100644 --- a/base/modules/desc/psb_hash_map_mod.F90 +++ b/base/modules/desc/psb_hash_map_mod.F90 @@ -106,7 +106,7 @@ module psb_hash_map_mod & hash_bld_g2l_map, hash_inner_cnvs2, hash_inner_cnvs1, & & hash_inner_cnv2, hash_inner_cnv1, hash_row_extendable - integer(psb_ipk_), private :: laddsz=500 + integer(psb_ipk_), private :: psb_laddsz=500 interface hash_inner_cnv module procedure hash_inner_cnvs2, hash_inner_cnv2,& @@ -648,7 +648,7 @@ contains use psb_realloc_mod use psb_sort_mod use psb_penv_mod -#ifdef OPENMP +#ifdef PSB_OPENMP use omp_lib #endif @@ -668,7 +668,7 @@ contains character(len=20) :: name,ch_err logical, allocatable :: mask_(:) !!$ logical :: use_openmp = .true. -#ifdef OPENMP +#ifdef PSB_OPENMP integer(kind = OMP_lock_kind) :: ins_lck #endif logical, volatile :: isLoopValid @@ -698,14 +698,15 @@ contains mglob = idxmap%get_gr() nrow = idxmap%get_lr() !write(0,*) me,name,' before loop ',psb_errstatus_fatal() -#if defined(OPENMP) +#if 0&& defined(PSB_OPENMP) + !$omp critical(hash_g2l_ins) isLoopValid = .true. if (idxmap%is_bld()) then if (present(lidx)) then if (present(mask)) then ! $ o m p parallel do default(none) schedule(dynamic) & - ! $ o m p shared(lidx,mask,name,me,is,idx,ins_lck,mglob,idxmap,ncol,nrow,laddsz) & + ! $ o m p shared(lidx,mask,name,me,is,idx,ins_lck,mglob,idxmap,ncol,nrow,psb_laddsz) & ! $ o m p private(i,ip,lip,tlip,nxt,info) & ! $ o m p reduction(.AND.:isLoopValid) do i = 1, is @@ -722,7 +723,7 @@ contains idx(i) = lip info = psb_success_ else - !$omp critical(hash_g2l_ins) + ! $ o m p critical(hash_g2l_ins) tlip = lip nxt = lidx(i) if (nxt <= nrow) then @@ -738,9 +739,10 @@ contains if (info >=0) then if (nxt == lip) then call psb_ensure_size(lip,idxmap%loc_to_glob,info,& - & pad=-1_psb_lpk_,addsz=laddsz) + & pad=-1_psb_lpk_,addsz=psb_laddsz) if (info /= psb_success_) then - info=1 + write(0,*)'Problem 1:',info,lip,size(idxmap%loc_to_glob) + info=lip call psb_errpush(psb_err_from_subroutine_ai_,name,& & a_err='psb_ensure_size',i_err=(/info/)) isLoopValid = .false. @@ -758,7 +760,7 @@ contains end if end if endif - !$omp end critical(hash_g2l_ins) + ! $ o m p end critical(hash_g2l_ins) end if else idx(i) = -1 @@ -769,7 +771,7 @@ contains else if (.not.present(mask)) then ! $ o m p parallel do default(none) schedule(dynamic) & - ! $ o m p shared(lidx,name,me,is,idx,ins_lck,mglob,idxmap,ncol,nrow,laddsz) & + ! $ o m p shared(lidx,name,me,is,idx,ins_lck,mglob,idxmap,ncol,nrow,psb_laddsz) & ! $ o m p private(i,ip,lip,tlip,nxt,info) & ! $ o m p reduction(.AND.:isLoopValid) do i = 1, is @@ -785,7 +787,7 @@ contains idx(i) = lip info = psb_success_ else - !$omp critical(hash_g2l_ins) + ! $ o m p critical(hash_g2l_ins) tlip = lip nxt = lidx(i) if (nxt <= nrow) then @@ -801,9 +803,10 @@ contains if (info >=0) then if (nxt == lip) then call psb_ensure_size(lip,idxmap%loc_to_glob,info,& - & pad=-1_psb_lpk_,addsz=laddsz) + & pad=-1_psb_lpk_,addsz=psb_laddsz) if (info /= psb_success_) then - info=1 + write(0,*)'Problem 2:',info,lip,size(idxmap%loc_to_glob) + info=lip call psb_errpush(psb_err_from_subroutine_ai_,name,& & a_err='psb_ensure_size',i_err=(/info/)) isLoopValid = .false. @@ -821,7 +824,7 @@ contains end if end if endif - !$omp end critical(hash_g2l_ins) + ! $ o m p end critical(hash_g2l_ins) end if enddo ! $ o m p end parallel do @@ -831,7 +834,7 @@ contains if (present(mask)) then ! $ o m p parallel do default(none) schedule(dynamic) & - ! $ o m p shared(mask,name,me,is,idx,ins_lck,mglob,idxmap,ncol,nrow,laddsz) & + ! $ o m p shared(mask,name,me,is,idx,ins_lck,mglob,idxmap,ncol,nrow,psb_laddsz) & ! $ o m p private(i,ip,lip,tlip,nxt,info) & ! $ o m p reduction(.AND.:isLoopValid) do i = 1, is @@ -848,7 +851,7 @@ contains idx(i) = lip info = psb_success_ else - !$omp critical(hash_g2l_ins) + ! $ o m p critical(hash_g2l_ins) ncol = idxmap%get_lc() nxt = ncol + 1 call hash_inner_cnv(ip,lip,idxmap%hashvmask,idxmap%hashv,& @@ -859,11 +862,14 @@ contains call psb_hash_searchinskey(ip,tlip,nxt,idxmap%hash,info) lip = tlip if (info >=0) then - if (nxt == lip) then - call psb_ensure_size(lip,idxmap%loc_to_glob,info,& - & pad=-1_psb_lpk_,addsz=laddsz) + if (nxt == lip) then + if (lip > size(idxmap%loc_to_glob)) then + call psb_ensure_size(lip,idxmap%loc_to_glob,info,& + & pad=-1_psb_lpk_,addsz=psb_laddsz) + end if if (info /= psb_success_) then - info=1 + write(0,*)'Problem 3:',info,lip,size(idxmap%loc_to_glob) + info=lip call psb_errpush(psb_err_from_subroutine_ai_,name,& & a_err='psb_ensure_size',i_err=(/info/)) isLoopValid = .false. @@ -879,7 +885,7 @@ contains isLoopValid = .false. end if end if - !$omp end critical(hash_g2l_ins) + ! $ o m p end critical(hash_g2l_ins) end if else idx(i) = -1 @@ -890,7 +896,7 @@ contains else if (.not.present(mask)) then ! $ o m p parallel do default(none) schedule(dynamic) & - ! $ o m p shared(name,me,is,idx,ins_lck,mglob,idxmap,ncol,nrow,laddsz) & + ! $ o m p shared(name,me,is,idx,ins_lck,mglob,idxmap,ncol,nrow,psb_laddsz) & ! $ o m p private(i,ip,lip,tlip,nxt,info) & ! $ o m p reduction(.AND.:isLoopValid) do i = 1, is @@ -906,7 +912,7 @@ contains idx(i) = lip info = psb_success_ else - !$omp critical(hash_g2l_ins) + ! $ o m p critical(hash_g2l_ins) ncol = idxmap%get_lc() nxt = ncol + 1 call hash_inner_cnv(ip,lip,idxmap%hashvmask,idxmap%hashv,& @@ -919,9 +925,10 @@ contains if (info >=0) then if (nxt == lip) then call psb_ensure_size(lip,idxmap%loc_to_glob,info,& - & pad=-1_psb_lpk_,addsz=laddsz) + & pad=-1_psb_lpk_,addsz=psb_laddsz) if (info /= psb_success_) then - info=1 + write(0,*)'Problem 4:',info,lip,size(idxmap%loc_to_glob) + info=lip call psb_errpush(psb_err_from_subroutine_ai_,name,& & a_err='psb_ensure_size',i_err=(/info/)) isLoopValid = .false. @@ -937,7 +944,7 @@ contains isLoopValid = .false. end if end if - !$omp end critical(hash_g2l_ins) + ! $ o m p end critical(hash_g2l_ins) end if enddo ! $ o m p end parallel do @@ -948,6 +955,7 @@ contains idx = -1 info = -1 end if + !$omp end critical(hash_g2l_ins) if (.not. isLoopValid) goto 9999 #else !!$ else if (.not.use_openmp) then @@ -978,9 +986,11 @@ contains if (nxt == tlip) then ncol = max(ncol,nxt) call psb_ensure_size(ncol,idxmap%loc_to_glob,info,& - & pad=-1_psb_lpk_,addsz=laddsz) + & pad=-1_psb_lpk_,addsz=psb_laddsz) if (info /= psb_success_) then - !write(0,*) 'Error spot' + !write(0,*) 'Error spot' + write(0,*)'Problem 5:',info,lip,size(idxmap%loc_to_glob) + info = lip call psb_errpush(psb_err_from_subroutine_ai_,name,& &a_err='psb_ensure_size',i_err=(/info/)) isLoopValid = .false. @@ -1026,10 +1036,11 @@ contains if (nxt == lip) then ncol = max(nxt,ncol) call psb_ensure_size(ncol,idxmap%loc_to_glob,info,& - & pad=-1_psb_lpk_,addsz=laddsz) + & pad=-1_psb_lpk_,addsz=psb_laddsz) if (info /= psb_success_) then - info=1 !write(0,*) 'Error spot' + write(0,*)'Problem 6:',info,lip,size(idxmap%loc_to_glob) + info = lip call psb_errpush(psb_err_from_subroutine_ai_,name,& &a_err='psb_ensure_size',i_err=(/info/)) isLoopValid = .false. @@ -1073,10 +1084,10 @@ contains if (nxt == lip) then ncol = nxt call psb_ensure_size(ncol,idxmap%loc_to_glob,info,& - & pad=-1_psb_lpk_,addsz=laddsz) + & pad=-1_psb_lpk_,addsz=psb_laddsz) if (info /= psb_success_) then - info=1 - write(0,*) 'Error spot 5' + write(0,*)'Problem 7:',info,lip,size(idxmap%loc_to_glob) + info = lip call psb_errpush(psb_err_from_subroutine_ai_,name,& & a_err='psb_ensure_size',i_err=(/info/)) isLoopValid = .false. @@ -1117,10 +1128,10 @@ contains if (nxt == lip) then ncol = nxt call psb_ensure_size(ncol,idxmap%loc_to_glob,info,& - & pad=-1_psb_lpk_,addsz=laddsz) + & pad=-1_psb_lpk_,addsz=psb_laddsz) if (info /= psb_success_) then - info=1 - write(0,*) 'Error spot 6' + write(0,*)'Problem 8:',info,lip,size(idxmap%loc_to_glob) + info = lip ch_err='psb_ensure_size' call psb_errpush(psb_err_from_subroutine_ai_,name,& &a_err=ch_err,i_err=(/info,izero,izero,izero,izero/)) @@ -1354,7 +1365,7 @@ contains idxmap%global_cols = ntot idxmap%local_rows = nl idxmap%local_cols = nl - idxmap%ctxt = ctxt + idxmap%ctxt = ctxt idxmap%state = psb_desc_bld_ idxmap%mpic = psb_get_mpi_comm(ctxt) diff --git a/base/modules/desc/psb_hash_mod.F90 b/base/modules/desc/psb_hash_mod.F90 index 18b1142d..c2839cf4 100644 --- a/base/modules/desc/psb_hash_mod.F90 +++ b/base/modules/desc/psb_hash_mod.F90 @@ -71,7 +71,7 @@ module psb_hash_mod integer(psb_ipk_), parameter :: HashNotFound = -256 interface psb_hashval -#if defined(IPK4) +#if defined(PSB_IPK4) function psb_c_hashval_32(key) bind(c) result(res) import psb_c_ipk_ implicit none @@ -79,7 +79,7 @@ module psb_hash_mod integer(psb_c_ipk_) :: res end function psb_c_hashval_32 #endif -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) function psb_c_hashval_64_32(key) bind(c) result(res) import psb_c_ipk_, psb_c_lpk_ implicit none @@ -87,7 +87,7 @@ module psb_hash_mod integer(psb_c_ipk_) :: res end function psb_c_hashval_64_32 #endif -#if defined(IPK8) +#if defined(PSB_IPK8) function psb_c_hashval_64(key) bind(c) result(res) import psb_c_ipk_ implicit none @@ -115,7 +115,7 @@ module psb_hash_mod module procedure psb_hash_lsearchkey end interface psb_hash_searchkey -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) interface psb_hash_init module procedure psb_hash_init_v, psb_hash_init_n end interface diff --git a/base/modules/desc/psb_indx_map_mod.F90 b/base/modules/desc/psb_indx_map_mod.F90 index f35cba1f..574aa2e3 100644 --- a/base/modules/desc/psb_indx_map_mod.F90 +++ b/base/modules/desc/psb_indx_map_mod.F90 @@ -153,7 +153,7 @@ module psb_indx_map_mod procedure, pass(idxmap) :: set_gci => base_set_gci procedure, pass(idxmap) :: set_grl => base_set_grl procedure, pass(idxmap) :: set_gcl => base_set_gcl -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) generic, public :: set_gr => set_grl, set_gri generic, public :: set_gc => set_gcl, set_gci #else @@ -165,7 +165,7 @@ module psb_indx_map_mod procedure, pass(idxmap) :: set_lci => base_set_lci procedure, pass(idxmap) :: set_lcl => base_set_lcl procedure, pass(idxmap) :: inc_lc => base_inc_lc -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) generic, public :: set_lr => set_lrl, set_lri generic, public :: set_lc => set_lcl, set_lci #else diff --git a/base/modules/desc/psb_list_map_mod.F90 b/base/modules/desc/psb_list_map_mod.F90 index 446339bd..3d493d51 100644 --- a/base/modules/desc/psb_list_map_mod.F90 +++ b/base/modules/desc/psb_list_map_mod.F90 @@ -528,7 +528,7 @@ contains if ((1<= idx(i)).and.(idx(i) <= idxmap%global_rows)) then ix = idxmap%glob_to_loc(idx(i)) if (ix < 0) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP CRITICAL(LISTINS) ix = idxmap%glob_to_loc(idx(i)) if (ix < 0) then @@ -573,7 +573,7 @@ contains if ((1<= idx(i)).and.(idx(i) <= idxmap%global_rows)) then ix = idxmap%glob_to_loc(idx(i)) if (ix < 0) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP CRITICAL(LISTINS) ix = idxmap%glob_to_loc(idx(i)) if (ix < 0) then @@ -617,7 +617,7 @@ contains if ((1<= idx(i)).and.(idx(i) <= idxmap%global_rows)) then ix = idxmap%glob_to_loc(idx(i)) if (ix < 0) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP CRITICAL(LISTINS) ix = idxmap%glob_to_loc(idx(i)) if (ix < 0) then @@ -658,7 +658,7 @@ contains if ((1<= idx(i)).and.(idx(i) <= idxmap%global_rows)) then ix = idxmap%glob_to_loc(idx(i)) if (ix < 0) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP CRITICAL(LISTINS) ix = idxmap%glob_to_loc(idx(i)) if (ix < 0) then @@ -745,7 +745,7 @@ contains if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)) then ix = idxmap%glob_to_loc(idxin(i)) if (ix < 0) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP CRITICAL(LISTINS) ix = idxmap%glob_to_loc(idxin(i)) if (ix < 0) then @@ -786,7 +786,7 @@ contains if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)) then ix = idxmap%glob_to_loc(idxin(i)) if (ix < 0) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP CRITICAL(LISTINS) ix = idxmap%glob_to_loc(idxin(i)) if (ix < 0) then @@ -829,7 +829,7 @@ contains if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)) then ix = idxmap%glob_to_loc(idxin(i)) if (ix < 0) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP CRITICAL(LISTINS) ix = idxmap%glob_to_loc(idxin(i)) if (ix < 0) then @@ -870,7 +870,7 @@ contains if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)) then ix = idxmap%glob_to_loc(idxin(i)) if (ix < 0) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP CRITICAL(LISTINS) ix = idxmap%glob_to_loc(idxin(i)) if (ix < 0) then diff --git a/base/modules/penv/psi_c_collective_mod.F90 b/base/modules/penv/psi_c_collective_mod.F90 index dab33b65..a05addf4 100644 --- a/base/modules/penv/psi_c_collective_mod.F90 +++ b/base/modules/penv/psi_c_collective_mod.F90 @@ -89,11 +89,11 @@ contains ! gather ! subroutine psb_cgather_s(ctxt,dat,resv,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -107,7 +107,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(1) = dat #else call psb_info(ctxt,iam,np) @@ -157,11 +157,11 @@ contains end subroutine psb_cgather_s subroutine psb_cgather_v(ctxt,dat,resv,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -175,7 +175,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(:) = dat(:) #else call psb_info(ctxt,iam,np) @@ -225,11 +225,11 @@ contains end subroutine psb_cgather_v subroutine psb_cgatherv_v(ctxt,dat,resv,szs,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -245,7 +245,7 @@ contains integer(psb_mpk_), allocatable :: displs(:) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(:) = dat(:) #else call psb_info(ctxt,iam,np) @@ -334,11 +334,11 @@ contains ! subroutine psb_csums(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -352,7 +352,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -410,11 +410,11 @@ contains end subroutine psb_csums subroutine psb_csumv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -428,7 +428,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -487,11 +487,11 @@ contains end subroutine psb_csumv subroutine psb_csumm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -505,7 +505,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -568,11 +568,11 @@ contains ! subroutine psb_camxs(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -586,7 +586,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -645,11 +645,11 @@ contains end subroutine psb_camxs subroutine psb_camxv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -663,7 +663,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -722,11 +722,11 @@ contains end subroutine psb_camxv subroutine psb_camxm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -740,7 +740,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -802,11 +802,11 @@ contains ! AMN: Minimum Absolute Value ! subroutine psb_camns(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -820,7 +820,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -879,11 +879,11 @@ contains end subroutine psb_camns subroutine psb_camnv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -897,7 +897,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -956,11 +956,11 @@ contains end subroutine psb_camnv subroutine psb_camnm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -974,7 +974,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1037,11 +1037,11 @@ contains ! BCAST Broadcast ! subroutine psb_cbcasts(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1056,7 +1056,7 @@ contains logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1092,11 +1092,11 @@ contains end subroutine psb_cbcasts subroutine psb_cbcastv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1110,7 +1110,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1147,11 +1147,11 @@ contains end subroutine psb_cbcastv subroutine psb_cbcastm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1165,7 +1165,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1209,11 +1209,11 @@ contains ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine psb_cscan_sums(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1227,7 +1227,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1260,11 +1260,11 @@ contains end subroutine psb_cscan_sums subroutine psb_cexscan_sums(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1279,7 +1279,7 @@ contains logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1314,11 +1314,11 @@ contains end subroutine psb_cexscan_sums subroutine psb_cscan_sumv(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1332,7 +1332,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync complex(psb_spk_), allocatable :: dat_(:) -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1365,11 +1365,11 @@ contains end subroutine psb_cscan_sumv subroutine psb_cexscan_sumv(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1384,7 +1384,7 @@ contains logical :: collective_start, collective_end, collective_sync complex(psb_spk_), allocatable :: dat_(:) -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1457,11 +1457,11 @@ contains subroutine psb_c_m_simple_triad_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & valrcv,iarcv,jarcv,rvsz,brvindx,ctxt,info) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif complex(psb_spk_), intent(in), target :: valsnd(:) @@ -1540,11 +1540,11 @@ contains subroutine psb_c_e_simple_triad_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & valrcv,iarcv,jarcv,rvsz,brvindx,ctxt,info) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif complex(psb_spk_), intent(in), target :: valsnd(:) diff --git a/base/modules/penv/psi_c_p2p_mod.F90 b/base/modules/penv/psi_c_p2p_mod.F90 index 245a98b6..183584ff 100644 --- a/base/modules/penv/psi_c_p2p_mod.F90 +++ b/base/modules/penv/psi_c_p2p_mod.F90 @@ -44,11 +44,11 @@ module psi_c_p2p_mod contains subroutine psb_csnds(ctxt,dat,dst) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -56,7 +56,7 @@ contains integer(psb_mpk_), intent(in) :: dst complex(psb_spk_), allocatable :: dat_(:) integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else allocate(dat_(1), stat=info) @@ -67,11 +67,11 @@ contains subroutine psb_csndv(ctxt,dat,dst) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -80,7 +80,7 @@ contains complex(psb_spk_), allocatable :: dat_(:) integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else allocate(dat_(size(dat)), stat=info) dat_(:) = dat(:) @@ -91,11 +91,11 @@ contains subroutine psb_csndm(ctxt,dat,dst,m) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -106,7 +106,7 @@ contains integer(psb_ipk_) :: i,j,k,m_,n_ integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else if (present(m)) then m_ = m @@ -127,11 +127,11 @@ contains end subroutine psb_csndm subroutine psb_crcvs(ctxt,dat,src) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -139,7 +139,7 @@ contains integer(psb_mpk_), intent(in) :: src integer(psb_mpk_) :: info, icomm integer(psb_mpk_) :: status(mpi_status_size) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else icomm = psb_get_mpi_comm(ctxt) @@ -150,11 +150,11 @@ contains subroutine psb_crcvv(ctxt,dat,src) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -163,7 +163,7 @@ contains complex(psb_spk_), allocatable :: dat_(:) integer(psb_mpk_) :: info, icomm integer(psb_mpk_) :: status(mpi_status_size) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else icomm = psb_get_mpi_comm(ctxt) call mpi_recv(dat,size(dat),psb_mpi_c_spk_,src,psb_complex_tag,icomm,status,info) @@ -174,11 +174,11 @@ contains subroutine psb_crcvm(ctxt,dat,src,m) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -189,7 +189,7 @@ contains integer(psb_mpk_) :: info ,m_,n_, ld, mp_rcv_type integer(psb_mpk_) :: i,j,k integer(psb_mpk_) :: status(mpi_status_size), icomm -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! What should we do here?? #else if (present(m)) then diff --git a/base/modules/penv/psi_collective_mod.F90 b/base/modules/penv/psi_collective_mod.F90 index 2a669c53..4ca131d4 100644 --- a/base/modules/penv/psi_collective_mod.F90 +++ b/base/modules/penv/psi_collective_mod.F90 @@ -53,11 +53,11 @@ module psi_collective_mod contains subroutine psb_hbcasts(ctxt,dat,root,length) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -66,7 +66,7 @@ contains integer(psb_mpk_) :: iam, np, root_,length_,info, icomm -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) if (present(root)) then root_ = root else @@ -86,11 +86,11 @@ contains end subroutine psb_hbcasts subroutine psb_hbcastv(ctxt,dat,root) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -100,7 +100,7 @@ contains integer(psb_mpk_) :: iam, np, root_, icomm integer(psb_mpk_) :: length_,info, size_ -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) if (present(root)) then root_ = root else @@ -117,11 +117,11 @@ contains end subroutine psb_hbcastv subroutine psb_lbcasts(ctxt,dat,root) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -130,7 +130,7 @@ contains integer(psb_mpk_) :: iam, np, root_,info, icomm -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) if (present(root)) then root_ = root else @@ -145,11 +145,11 @@ contains end subroutine psb_lbcasts subroutine psb_lallreduceand(ctxt,dat,rec) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -158,7 +158,7 @@ contains integer(psb_mpk_) :: iam, np, info, icomm -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(rec)) then @@ -172,11 +172,11 @@ end subroutine psb_lallreduceand subroutine psb_lbcastv(ctxt,dat,root) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -185,7 +185,7 @@ end subroutine psb_lallreduceand integer(psb_mpk_) :: iam, np, root_,info, icomm -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) if (present(root)) then root_ = root else @@ -201,11 +201,11 @@ end subroutine psb_lallreduceand #if defined(SHORT_INTEGERS) subroutine psb_i2sums(ctxt,dat,root) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_mpk_), intent(in) :: ctxt @@ -216,7 +216,7 @@ end subroutine psb_lallreduceand integer(psb_mpk_) :: iam, np, info, icomm integer(psb_ipk_) :: iinfo -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -239,11 +239,11 @@ end subroutine psb_lallreduceand subroutine psb_i2sumv(ctxt,dat,root) use psb_realloc_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_mpk_), intent(in) :: ctxt @@ -254,7 +254,7 @@ end subroutine psb_lallreduceand integer(psb_mpk_) :: iam, np, info, icomm integer(psb_ipk_) :: iinfo -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -283,11 +283,11 @@ end subroutine psb_lallreduceand subroutine psb_i2summ(ctxt,dat,root) use psb_realloc_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_mpk_), intent(in) :: ctxt @@ -299,7 +299,7 @@ end subroutine psb_lallreduceand integer(psb_ipk_) :: iinfo -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then diff --git a/base/modules/penv/psi_d_collective_mod.F90 b/base/modules/penv/psi_d_collective_mod.F90 index 52d4ff2d..9bd392ef 100644 --- a/base/modules/penv/psi_d_collective_mod.F90 +++ b/base/modules/penv/psi_d_collective_mod.F90 @@ -102,11 +102,11 @@ contains ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine psb_dmaxs(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -121,7 +121,7 @@ contains logical :: collective_start, collective_end, collective_sync real(psb_dpk_) :: dat_ -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -176,11 +176,11 @@ contains end subroutine psb_dmaxs subroutine psb_dmaxv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -196,7 +196,7 @@ contains real(psb_dpk_) :: dat_(1) ! This is a dummy -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -255,11 +255,11 @@ contains end subroutine psb_dmaxv subroutine psb_dmaxm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -275,7 +275,7 @@ contains real(psb_dpk_) :: dat_(1,1) ! this is a dummy -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -337,11 +337,11 @@ contains ! MIN: Minimum Value ! subroutine psb_dmins(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -355,7 +355,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -411,11 +411,11 @@ contains end subroutine psb_dmins subroutine psb_dminv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -429,7 +429,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -488,11 +488,11 @@ contains end subroutine psb_dminv subroutine psb_dminm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -506,7 +506,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -571,11 +571,11 @@ contains ! ! !!!!!!!!!!!! subroutine psb_d_nrm2s(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -589,7 +589,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -648,11 +648,11 @@ contains end subroutine psb_d_nrm2s subroutine psb_d_nrm2v(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -666,7 +666,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -729,11 +729,11 @@ contains ! gather ! subroutine psb_dgather_s(ctxt,dat,resv,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -747,7 +747,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(1) = dat #else call psb_info(ctxt,iam,np) @@ -797,11 +797,11 @@ contains end subroutine psb_dgather_s subroutine psb_dgather_v(ctxt,dat,resv,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -815,7 +815,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(:) = dat(:) #else call psb_info(ctxt,iam,np) @@ -865,11 +865,11 @@ contains end subroutine psb_dgather_v subroutine psb_dgatherv_v(ctxt,dat,resv,szs,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -885,7 +885,7 @@ contains integer(psb_mpk_), allocatable :: displs(:) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(:) = dat(:) #else call psb_info(ctxt,iam,np) @@ -974,11 +974,11 @@ contains ! subroutine psb_dsums(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -992,7 +992,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1050,11 +1050,11 @@ contains end subroutine psb_dsums subroutine psb_dsumv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1068,7 +1068,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1127,11 +1127,11 @@ contains end subroutine psb_dsumv subroutine psb_dsumm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1145,7 +1145,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1208,11 +1208,11 @@ contains ! subroutine psb_damxs(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1226,7 +1226,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1285,11 +1285,11 @@ contains end subroutine psb_damxs subroutine psb_damxv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1303,7 +1303,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1362,11 +1362,11 @@ contains end subroutine psb_damxv subroutine psb_damxm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1380,7 +1380,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1442,11 +1442,11 @@ contains ! AMN: Minimum Absolute Value ! subroutine psb_damns(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1460,7 +1460,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1519,11 +1519,11 @@ contains end subroutine psb_damns subroutine psb_damnv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1537,7 +1537,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1596,11 +1596,11 @@ contains end subroutine psb_damnv subroutine psb_damnm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1614,7 +1614,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1677,11 +1677,11 @@ contains ! BCAST Broadcast ! subroutine psb_dbcasts(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1696,7 +1696,7 @@ contains logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1732,11 +1732,11 @@ contains end subroutine psb_dbcasts subroutine psb_dbcastv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1750,7 +1750,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1787,11 +1787,11 @@ contains end subroutine psb_dbcastv subroutine psb_dbcastm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1805,7 +1805,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1849,11 +1849,11 @@ contains ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine psb_dscan_sums(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1867,7 +1867,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1900,11 +1900,11 @@ contains end subroutine psb_dscan_sums subroutine psb_dexscan_sums(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1919,7 +1919,7 @@ contains logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1954,11 +1954,11 @@ contains end subroutine psb_dexscan_sums subroutine psb_dscan_sumv(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1972,7 +1972,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync real(psb_dpk_), allocatable :: dat_(:) -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -2005,11 +2005,11 @@ contains end subroutine psb_dscan_sumv subroutine psb_dexscan_sumv(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -2024,7 +2024,7 @@ contains logical :: collective_start, collective_end, collective_sync real(psb_dpk_), allocatable :: dat_(:) -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -2097,11 +2097,11 @@ contains subroutine psb_d_m_simple_triad_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & valrcv,iarcv,jarcv,rvsz,brvindx,ctxt,info) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif real(psb_dpk_), intent(in), target :: valsnd(:) @@ -2180,11 +2180,11 @@ contains subroutine psb_d_e_simple_triad_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & valrcv,iarcv,jarcv,rvsz,brvindx,ctxt,info) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif real(psb_dpk_), intent(in), target :: valsnd(:) diff --git a/base/modules/penv/psi_d_p2p_mod.F90 b/base/modules/penv/psi_d_p2p_mod.F90 index 614c6802..280f328d 100644 --- a/base/modules/penv/psi_d_p2p_mod.F90 +++ b/base/modules/penv/psi_d_p2p_mod.F90 @@ -44,11 +44,11 @@ module psi_d_p2p_mod contains subroutine psb_dsnds(ctxt,dat,dst) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -56,7 +56,7 @@ contains integer(psb_mpk_), intent(in) :: dst real(psb_dpk_), allocatable :: dat_(:) integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else allocate(dat_(1), stat=info) @@ -67,11 +67,11 @@ contains subroutine psb_dsndv(ctxt,dat,dst) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -80,7 +80,7 @@ contains real(psb_dpk_), allocatable :: dat_(:) integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else allocate(dat_(size(dat)), stat=info) dat_(:) = dat(:) @@ -91,11 +91,11 @@ contains subroutine psb_dsndm(ctxt,dat,dst,m) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -106,7 +106,7 @@ contains integer(psb_ipk_) :: i,j,k,m_,n_ integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else if (present(m)) then m_ = m @@ -127,11 +127,11 @@ contains end subroutine psb_dsndm subroutine psb_drcvs(ctxt,dat,src) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -139,7 +139,7 @@ contains integer(psb_mpk_), intent(in) :: src integer(psb_mpk_) :: info, icomm integer(psb_mpk_) :: status(mpi_status_size) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else icomm = psb_get_mpi_comm(ctxt) @@ -150,11 +150,11 @@ contains subroutine psb_drcvv(ctxt,dat,src) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -163,7 +163,7 @@ contains real(psb_dpk_), allocatable :: dat_(:) integer(psb_mpk_) :: info, icomm integer(psb_mpk_) :: status(mpi_status_size) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else icomm = psb_get_mpi_comm(ctxt) call mpi_recv(dat,size(dat),psb_mpi_r_dpk_,src,psb_double_tag,icomm,status,info) @@ -174,11 +174,11 @@ contains subroutine psb_drcvm(ctxt,dat,src,m) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -189,7 +189,7 @@ contains integer(psb_mpk_) :: info ,m_,n_, ld, mp_rcv_type integer(psb_mpk_) :: i,j,k integer(psb_mpk_) :: status(mpi_status_size), icomm -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! What should we do here?? #else if (present(m)) then diff --git a/base/modules/penv/psi_e_collective_mod.F90 b/base/modules/penv/psi_e_collective_mod.F90 index 20f99d5c..8ce5b75a 100644 --- a/base/modules/penv/psi_e_collective_mod.F90 +++ b/base/modules/penv/psi_e_collective_mod.F90 @@ -99,11 +99,11 @@ contains ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine psb_emaxs(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -118,7 +118,7 @@ contains logical :: collective_start, collective_end, collective_sync integer(psb_epk_) :: dat_ -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -173,11 +173,11 @@ contains end subroutine psb_emaxs subroutine psb_emaxv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -193,7 +193,7 @@ contains integer(psb_epk_) :: dat_(1) ! This is a dummy -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -252,11 +252,11 @@ contains end subroutine psb_emaxv subroutine psb_emaxm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -272,7 +272,7 @@ contains integer(psb_epk_) :: dat_(1,1) ! this is a dummy -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -334,11 +334,11 @@ contains ! MIN: Minimum Value ! subroutine psb_emins(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -352,7 +352,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -408,11 +408,11 @@ contains end subroutine psb_emins subroutine psb_eminv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -426,7 +426,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -485,11 +485,11 @@ contains end subroutine psb_eminv subroutine psb_eminm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -503,7 +503,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -567,11 +567,11 @@ contains ! gather ! subroutine psb_egather_s(ctxt,dat,resv,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -585,7 +585,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(1) = dat #else call psb_info(ctxt,iam,np) @@ -635,11 +635,11 @@ contains end subroutine psb_egather_s subroutine psb_egather_v(ctxt,dat,resv,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -653,7 +653,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(:) = dat(:) #else call psb_info(ctxt,iam,np) @@ -703,11 +703,11 @@ contains end subroutine psb_egather_v subroutine psb_egatherv_v(ctxt,dat,resv,szs,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -723,7 +723,7 @@ contains integer(psb_mpk_), allocatable :: displs(:) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(:) = dat(:) #else call psb_info(ctxt,iam,np) @@ -812,11 +812,11 @@ contains ! subroutine psb_esums(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -830,7 +830,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -888,11 +888,11 @@ contains end subroutine psb_esums subroutine psb_esumv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -906,7 +906,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -965,11 +965,11 @@ contains end subroutine psb_esumv subroutine psb_esumm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -983,7 +983,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1046,11 +1046,11 @@ contains ! subroutine psb_eamxs(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1064,7 +1064,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1123,11 +1123,11 @@ contains end subroutine psb_eamxs subroutine psb_eamxv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1141,7 +1141,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1200,11 +1200,11 @@ contains end subroutine psb_eamxv subroutine psb_eamxm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1218,7 +1218,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1280,11 +1280,11 @@ contains ! AMN: Minimum Absolute Value ! subroutine psb_eamns(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1298,7 +1298,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1357,11 +1357,11 @@ contains end subroutine psb_eamns subroutine psb_eamnv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1375,7 +1375,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1434,11 +1434,11 @@ contains end subroutine psb_eamnv subroutine psb_eamnm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1452,7 +1452,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1515,11 +1515,11 @@ contains ! BCAST Broadcast ! subroutine psb_ebcasts(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1534,7 +1534,7 @@ contains logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1570,11 +1570,11 @@ contains end subroutine psb_ebcasts subroutine psb_ebcastv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1588,7 +1588,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1625,11 +1625,11 @@ contains end subroutine psb_ebcastv subroutine psb_ebcastm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1643,7 +1643,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1687,11 +1687,11 @@ contains ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine psb_escan_sums(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1705,7 +1705,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1738,11 +1738,11 @@ contains end subroutine psb_escan_sums subroutine psb_eexscan_sums(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1757,7 +1757,7 @@ contains logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1792,11 +1792,11 @@ contains end subroutine psb_eexscan_sums subroutine psb_escan_sumv(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1810,7 +1810,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync integer(psb_epk_), allocatable :: dat_(:) -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1843,11 +1843,11 @@ contains end subroutine psb_escan_sumv subroutine psb_eexscan_sumv(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1862,7 +1862,7 @@ contains logical :: collective_start, collective_end, collective_sync integer(psb_epk_), allocatable :: dat_(:) -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1935,11 +1935,11 @@ contains subroutine psb_e_m_simple_triad_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & valrcv,iarcv,jarcv,rvsz,brvindx,ctxt,info) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_epk_), intent(in), target :: valsnd(:) @@ -2018,11 +2018,11 @@ contains subroutine psb_e_e_simple_triad_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & valrcv,iarcv,jarcv,rvsz,brvindx,ctxt,info) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_epk_), intent(in), target :: valsnd(:) diff --git a/base/modules/penv/psi_e_p2p_mod.F90 b/base/modules/penv/psi_e_p2p_mod.F90 index 7c54bbf9..f6c37d8a 100644 --- a/base/modules/penv/psi_e_p2p_mod.F90 +++ b/base/modules/penv/psi_e_p2p_mod.F90 @@ -44,11 +44,11 @@ module psi_e_p2p_mod contains subroutine psb_esnds(ctxt,dat,dst) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -56,7 +56,7 @@ contains integer(psb_mpk_), intent(in) :: dst integer(psb_epk_), allocatable :: dat_(:) integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else allocate(dat_(1), stat=info) @@ -67,11 +67,11 @@ contains subroutine psb_esndv(ctxt,dat,dst) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -80,7 +80,7 @@ contains integer(psb_epk_), allocatable :: dat_(:) integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else allocate(dat_(size(dat)), stat=info) dat_(:) = dat(:) @@ -91,11 +91,11 @@ contains subroutine psb_esndm(ctxt,dat,dst,m) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -106,7 +106,7 @@ contains integer(psb_ipk_) :: i,j,k,m_,n_ integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else if (present(m)) then m_ = m @@ -127,11 +127,11 @@ contains end subroutine psb_esndm subroutine psb_ercvs(ctxt,dat,src) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -139,7 +139,7 @@ contains integer(psb_mpk_), intent(in) :: src integer(psb_mpk_) :: info, icomm integer(psb_mpk_) :: status(mpi_status_size) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else icomm = psb_get_mpi_comm(ctxt) @@ -150,11 +150,11 @@ contains subroutine psb_ercvv(ctxt,dat,src) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -163,7 +163,7 @@ contains integer(psb_epk_), allocatable :: dat_(:) integer(psb_mpk_) :: info, icomm integer(psb_mpk_) :: status(mpi_status_size) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else icomm = psb_get_mpi_comm(ctxt) call mpi_recv(dat,size(dat),psb_mpi_epk_,src,psb_int8_tag,icomm,status,info) @@ -174,11 +174,11 @@ contains subroutine psb_ercvm(ctxt,dat,src,m) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -189,7 +189,7 @@ contains integer(psb_mpk_) :: info ,m_,n_, ld, mp_rcv_type integer(psb_mpk_) :: i,j,k integer(psb_mpk_) :: status(mpi_status_size), icomm -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! What should we do here?? #else if (present(m)) then diff --git a/base/modules/penv/psi_i2_collective_mod.F90 b/base/modules/penv/psi_i2_collective_mod.F90 index b571f581..bcecbb8c 100644 --- a/base/modules/penv/psi_i2_collective_mod.F90 +++ b/base/modules/penv/psi_i2_collective_mod.F90 @@ -99,11 +99,11 @@ contains ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine psb_i2maxs(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -118,7 +118,7 @@ contains logical :: collective_start, collective_end, collective_sync integer(psb_i2pk_) :: dat_ -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -173,11 +173,11 @@ contains end subroutine psb_i2maxs subroutine psb_i2maxv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -193,7 +193,7 @@ contains integer(psb_i2pk_) :: dat_(1) ! This is a dummy -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -252,11 +252,11 @@ contains end subroutine psb_i2maxv subroutine psb_i2maxm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -272,7 +272,7 @@ contains integer(psb_i2pk_) :: dat_(1,1) ! this is a dummy -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -334,11 +334,11 @@ contains ! MIN: Minimum Value ! subroutine psb_i2mins(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -352,7 +352,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -408,11 +408,11 @@ contains end subroutine psb_i2mins subroutine psb_i2minv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -426,7 +426,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -485,11 +485,11 @@ contains end subroutine psb_i2minv subroutine psb_i2minm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -503,7 +503,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -567,11 +567,11 @@ contains ! gather ! subroutine psb_i2gather_s(ctxt,dat,resv,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -585,7 +585,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(1) = dat #else call psb_info(ctxt,iam,np) @@ -635,11 +635,11 @@ contains end subroutine psb_i2gather_s subroutine psb_i2gather_v(ctxt,dat,resv,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -653,7 +653,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(:) = dat(:) #else call psb_info(ctxt,iam,np) @@ -703,11 +703,11 @@ contains end subroutine psb_i2gather_v subroutine psb_i2gatherv_v(ctxt,dat,resv,szs,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -723,7 +723,7 @@ contains integer(psb_mpk_), allocatable :: displs(:) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(:) = dat(:) #else call psb_info(ctxt,iam,np) @@ -812,11 +812,11 @@ contains ! subroutine psb_i2sums(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -830,7 +830,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -888,11 +888,11 @@ contains end subroutine psb_i2sums subroutine psb_i2sumv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -906,7 +906,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -965,11 +965,11 @@ contains end subroutine psb_i2sumv subroutine psb_i2summ(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -983,7 +983,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1046,11 +1046,11 @@ contains ! subroutine psb_i2amxs(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1064,7 +1064,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1123,11 +1123,11 @@ contains end subroutine psb_i2amxs subroutine psb_i2amxv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1141,7 +1141,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1200,11 +1200,11 @@ contains end subroutine psb_i2amxv subroutine psb_i2amxm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1218,7 +1218,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1280,11 +1280,11 @@ contains ! AMN: Minimum Absolute Value ! subroutine psb_i2amns(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1298,7 +1298,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1357,11 +1357,11 @@ contains end subroutine psb_i2amns subroutine psb_i2amnv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1375,7 +1375,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1434,11 +1434,11 @@ contains end subroutine psb_i2amnv subroutine psb_i2amnm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1452,7 +1452,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1515,11 +1515,11 @@ contains ! BCAST Broadcast ! subroutine psb_i2bcasts(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1534,7 +1534,7 @@ contains logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1570,11 +1570,11 @@ contains end subroutine psb_i2bcasts subroutine psb_i2bcastv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1588,7 +1588,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1625,11 +1625,11 @@ contains end subroutine psb_i2bcastv subroutine psb_i2bcastm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1643,7 +1643,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1687,11 +1687,11 @@ contains ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine psb_i2scan_sums(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1705,7 +1705,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1738,11 +1738,11 @@ contains end subroutine psb_i2scan_sums subroutine psb_i2exscan_sums(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1757,7 +1757,7 @@ contains logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1792,11 +1792,11 @@ contains end subroutine psb_i2exscan_sums subroutine psb_i2scan_sumv(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1810,7 +1810,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync integer(psb_i2pk_), allocatable :: dat_(:) -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1843,11 +1843,11 @@ contains end subroutine psb_i2scan_sumv subroutine psb_i2exscan_sumv(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1862,7 +1862,7 @@ contains logical :: collective_start, collective_end, collective_sync integer(psb_i2pk_), allocatable :: dat_(:) -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1935,11 +1935,11 @@ contains subroutine psb_i2_m_simple_triad_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & valrcv,iarcv,jarcv,rvsz,brvindx,ctxt,info) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_i2pk_), intent(in), target :: valsnd(:) @@ -2018,11 +2018,11 @@ contains subroutine psb_i2_e_simple_triad_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & valrcv,iarcv,jarcv,rvsz,brvindx,ctxt,info) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_i2pk_), intent(in), target :: valsnd(:) diff --git a/base/modules/penv/psi_i2_p2p_mod.F90 b/base/modules/penv/psi_i2_p2p_mod.F90 index ad80cb44..4d2d3385 100644 --- a/base/modules/penv/psi_i2_p2p_mod.F90 +++ b/base/modules/penv/psi_i2_p2p_mod.F90 @@ -44,11 +44,11 @@ module psi_i2_p2p_mod contains subroutine psb_i2snds(ctxt,dat,dst) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -56,7 +56,7 @@ contains integer(psb_mpk_), intent(in) :: dst integer(psb_i2pk_), allocatable :: dat_(:) integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else allocate(dat_(1), stat=info) @@ -67,11 +67,11 @@ contains subroutine psb_i2sndv(ctxt,dat,dst) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -80,7 +80,7 @@ contains integer(psb_i2pk_), allocatable :: dat_(:) integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else allocate(dat_(size(dat)), stat=info) dat_(:) = dat(:) @@ -91,11 +91,11 @@ contains subroutine psb_i2sndm(ctxt,dat,dst,m) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -106,7 +106,7 @@ contains integer(psb_ipk_) :: i,j,k,m_,n_ integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else if (present(m)) then m_ = m @@ -127,11 +127,11 @@ contains end subroutine psb_i2sndm subroutine psb_i2rcvs(ctxt,dat,src) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -139,7 +139,7 @@ contains integer(psb_mpk_), intent(in) :: src integer(psb_mpk_) :: info, icomm integer(psb_mpk_) :: status(mpi_status_size) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else icomm = psb_get_mpi_comm(ctxt) @@ -150,11 +150,11 @@ contains subroutine psb_i2rcvv(ctxt,dat,src) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -163,7 +163,7 @@ contains integer(psb_i2pk_), allocatable :: dat_(:) integer(psb_mpk_) :: info, icomm integer(psb_mpk_) :: status(mpi_status_size) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else icomm = psb_get_mpi_comm(ctxt) call mpi_recv(dat,size(dat),psb_mpi_i2pk_,src,psb_int2_tag,icomm,status,info) @@ -174,11 +174,11 @@ contains subroutine psb_i2rcvm(ctxt,dat,src,m) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -189,7 +189,7 @@ contains integer(psb_mpk_) :: info ,m_,n_, ld, mp_rcv_type integer(psb_mpk_) :: i,j,k integer(psb_mpk_) :: status(mpi_status_size), icomm -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! What should we do here?? #else if (present(m)) then diff --git a/base/modules/penv/psi_m_collective_mod.F90 b/base/modules/penv/psi_m_collective_mod.F90 index ca4fc7d2..2205a1a8 100644 --- a/base/modules/penv/psi_m_collective_mod.F90 +++ b/base/modules/penv/psi_m_collective_mod.F90 @@ -99,11 +99,11 @@ contains ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine psb_mmaxs(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -118,7 +118,7 @@ contains logical :: collective_start, collective_end, collective_sync integer(psb_mpk_) :: dat_ -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -173,11 +173,11 @@ contains end subroutine psb_mmaxs subroutine psb_mmaxv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -193,7 +193,7 @@ contains integer(psb_mpk_) :: dat_(1) ! This is a dummy -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -252,11 +252,11 @@ contains end subroutine psb_mmaxv subroutine psb_mmaxm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -272,7 +272,7 @@ contains integer(psb_mpk_) :: dat_(1,1) ! this is a dummy -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -334,11 +334,11 @@ contains ! MIN: Minimum Value ! subroutine psb_mmins(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -352,7 +352,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -408,11 +408,11 @@ contains end subroutine psb_mmins subroutine psb_mminv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -426,7 +426,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -485,11 +485,11 @@ contains end subroutine psb_mminv subroutine psb_mminm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -503,7 +503,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -567,11 +567,11 @@ contains ! gather ! subroutine psb_mgather_s(ctxt,dat,resv,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -585,7 +585,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(1) = dat #else call psb_info(ctxt,iam,np) @@ -635,11 +635,11 @@ contains end subroutine psb_mgather_s subroutine psb_mgather_v(ctxt,dat,resv,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -653,7 +653,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(:) = dat(:) #else call psb_info(ctxt,iam,np) @@ -703,11 +703,11 @@ contains end subroutine psb_mgather_v subroutine psb_mgatherv_v(ctxt,dat,resv,szs,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -723,7 +723,7 @@ contains integer(psb_mpk_), allocatable :: displs(:) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(:) = dat(:) #else call psb_info(ctxt,iam,np) @@ -812,11 +812,11 @@ contains ! subroutine psb_msums(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -830,7 +830,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -888,11 +888,11 @@ contains end subroutine psb_msums subroutine psb_msumv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -906,7 +906,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -965,11 +965,11 @@ contains end subroutine psb_msumv subroutine psb_msumm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -983,7 +983,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1046,11 +1046,11 @@ contains ! subroutine psb_mamxs(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1064,7 +1064,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1123,11 +1123,11 @@ contains end subroutine psb_mamxs subroutine psb_mamxv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1141,7 +1141,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1200,11 +1200,11 @@ contains end subroutine psb_mamxv subroutine psb_mamxm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1218,7 +1218,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1280,11 +1280,11 @@ contains ! AMN: Minimum Absolute Value ! subroutine psb_mamns(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1298,7 +1298,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1357,11 +1357,11 @@ contains end subroutine psb_mamns subroutine psb_mamnv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1375,7 +1375,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1434,11 +1434,11 @@ contains end subroutine psb_mamnv subroutine psb_mamnm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1452,7 +1452,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1515,11 +1515,11 @@ contains ! BCAST Broadcast ! subroutine psb_mbcasts(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1534,7 +1534,7 @@ contains logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1570,11 +1570,11 @@ contains end subroutine psb_mbcasts subroutine psb_mbcastv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1588,7 +1588,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1625,11 +1625,11 @@ contains end subroutine psb_mbcastv subroutine psb_mbcastm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1643,7 +1643,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1687,11 +1687,11 @@ contains ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine psb_mscan_sums(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1705,7 +1705,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1738,11 +1738,11 @@ contains end subroutine psb_mscan_sums subroutine psb_mexscan_sums(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1757,7 +1757,7 @@ contains logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1792,11 +1792,11 @@ contains end subroutine psb_mexscan_sums subroutine psb_mscan_sumv(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1810,7 +1810,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync integer(psb_mpk_), allocatable :: dat_(:) -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1843,11 +1843,11 @@ contains end subroutine psb_mscan_sumv subroutine psb_mexscan_sumv(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1862,7 +1862,7 @@ contains logical :: collective_start, collective_end, collective_sync integer(psb_mpk_), allocatable :: dat_(:) -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1935,11 +1935,11 @@ contains subroutine psb_m_m_simple_triad_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & valrcv,iarcv,jarcv,rvsz,brvindx,ctxt,info) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_mpk_), intent(in), target :: valsnd(:) @@ -2018,11 +2018,11 @@ contains subroutine psb_m_e_simple_triad_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & valrcv,iarcv,jarcv,rvsz,brvindx,ctxt,info) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_mpk_), intent(in), target :: valsnd(:) diff --git a/base/modules/penv/psi_m_p2p_mod.F90 b/base/modules/penv/psi_m_p2p_mod.F90 index 9f6c7bc6..0132ce02 100644 --- a/base/modules/penv/psi_m_p2p_mod.F90 +++ b/base/modules/penv/psi_m_p2p_mod.F90 @@ -44,11 +44,11 @@ module psi_m_p2p_mod contains subroutine psb_msnds(ctxt,dat,dst) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -56,7 +56,7 @@ contains integer(psb_mpk_), intent(in) :: dst integer(psb_mpk_), allocatable :: dat_(:) integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else allocate(dat_(1), stat=info) @@ -67,11 +67,11 @@ contains subroutine psb_msndv(ctxt,dat,dst) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -80,7 +80,7 @@ contains integer(psb_mpk_), allocatable :: dat_(:) integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else allocate(dat_(size(dat)), stat=info) dat_(:) = dat(:) @@ -91,11 +91,11 @@ contains subroutine psb_msndm(ctxt,dat,dst,m) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -106,7 +106,7 @@ contains integer(psb_ipk_) :: i,j,k,m_,n_ integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else if (present(m)) then m_ = m @@ -127,11 +127,11 @@ contains end subroutine psb_msndm subroutine psb_mrcvs(ctxt,dat,src) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -139,7 +139,7 @@ contains integer(psb_mpk_), intent(in) :: src integer(psb_mpk_) :: info, icomm integer(psb_mpk_) :: status(mpi_status_size) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else icomm = psb_get_mpi_comm(ctxt) @@ -150,11 +150,11 @@ contains subroutine psb_mrcvv(ctxt,dat,src) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -163,7 +163,7 @@ contains integer(psb_mpk_), allocatable :: dat_(:) integer(psb_mpk_) :: info, icomm integer(psb_mpk_) :: status(mpi_status_size) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else icomm = psb_get_mpi_comm(ctxt) call mpi_recv(dat,size(dat),psb_mpi_mpk_,src,psb_int4_tag,icomm,status,info) @@ -174,11 +174,11 @@ contains subroutine psb_mrcvm(ctxt,dat,src,m) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -189,7 +189,7 @@ contains integer(psb_mpk_) :: info ,m_,n_, ld, mp_rcv_type integer(psb_mpk_) :: i,j,k integer(psb_mpk_) :: status(mpi_status_size), icomm -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! What should we do here?? #else if (present(m)) then diff --git a/base/modules/penv/psi_p2p_mod.F90 b/base/modules/penv/psi_p2p_mod.F90 index f7262378..275b5de7 100644 --- a/base/modules/penv/psi_p2p_mod.F90 +++ b/base/modules/penv/psi_p2p_mod.F90 @@ -66,11 +66,11 @@ contains ! !!!!!!!!!!!!!!!!!!!!!!!! subroutine psb_lsnds(ctxt,dat,dst) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -78,7 +78,7 @@ contains integer(psb_mpk_), intent(in) :: dst logical, allocatable :: dat_(:) integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else allocate(dat_(1), stat=info) @@ -89,11 +89,11 @@ contains subroutine psb_lsndv(ctxt,dat,dst) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -102,7 +102,7 @@ contains logical, allocatable :: dat_(:) integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else allocate(dat_(size(dat)), stat=info) dat_(:) = dat(:) @@ -113,11 +113,11 @@ contains subroutine psb_lsndm(ctxt,dat,dst,m) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -128,7 +128,7 @@ contains integer(psb_mpk_) :: info integer(psb_ipk_) :: i,j,k,m_,n_ -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else if (present(m)) then m_ = m @@ -150,11 +150,11 @@ contains subroutine psb_hsnds(ctxt,dat,dst) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -162,7 +162,7 @@ contains integer(psb_mpk_), intent(in) :: dst character(len=1), allocatable :: dat_(:) integer(psb_mpk_) :: info, l, i -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else l = len(dat) @@ -182,11 +182,11 @@ contains subroutine psb_lrcvs(ctxt,dat,src) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -194,7 +194,7 @@ contains integer(psb_mpk_), intent(in) :: src integer(psb_mpk_) :: info, icomm integer(psb_mpk_) :: status(mpi_status_size) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else icomm = psb_get_mpi_comm(ctxt) @@ -205,11 +205,11 @@ contains subroutine psb_lrcvv(ctxt,dat,src) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -217,7 +217,7 @@ contains integer(psb_mpk_), intent(in) :: src integer(psb_mpk_) :: info integer(psb_mpk_) :: status(mpi_status_size), icomm -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else icomm = psb_get_mpi_comm(ctxt) call mpi_recv(dat,size(dat),mpi_logical,src,psb_logical_tag,icomm,status,info) @@ -228,11 +228,11 @@ contains subroutine psb_lrcvm(ctxt,dat,src,m) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -242,7 +242,7 @@ contains integer(psb_mpk_) :: info ,m_,n_, ld, mp_rcv_type integer(psb_ipk_) :: i,j,k integer(psb_mpk_) :: status(mpi_status_size), icomm -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! What should we do here?? #else icomm = psb_get_mpi_comm(ctxt) @@ -269,11 +269,11 @@ contains subroutine psb_hrcvs(ctxt,dat,src) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -282,7 +282,7 @@ contains character(len=1), allocatable :: dat_(:) integer(psb_mpk_) :: info, l, i integer(psb_mpk_) :: status(mpi_status_size), icomm -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else l = len(dat) diff --git a/base/modules/penv/psi_penv_mod.F90 b/base/modules/penv/psi_penv_mod.F90 index 832ed486..9a15c888 100644 --- a/base/modules/penv/psi_penv_mod.F90 +++ b/base/modules/penv/psi_penv_mod.F90 @@ -29,7 +29,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! ! -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! Provide a fake mpi module just to keep the compiler(s) happy. module mpi use psb_const_mod @@ -55,6 +55,7 @@ module mpi interface function mpi_wtime() result(res) bind(c,name='mpi_wtime') import + real(c_double) :: res end function mpi_wtime end interface @@ -262,7 +263,7 @@ module psi_penv_mod interface psb_info module procedure psb_info_mpik end interface -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) interface psb_info module procedure psb_info_epk end interface @@ -284,7 +285,7 @@ module psi_penv_mod module procedure psb_m_get_mpi_rank!, psb_e_get_mpi_rank end interface psb_get_mpi_rank -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) integer(psb_mpk_), private, save :: nctxt=0 #else @@ -340,11 +341,11 @@ contains end subroutine psb_init_queue subroutine psb_wait_buffer(node, info) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_buffer_node), intent(inout) :: node @@ -356,11 +357,11 @@ contains end subroutine psb_wait_buffer subroutine psb_test_buffer(node, flag, info) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_buffer_node), intent(inout) :: node @@ -368,7 +369,7 @@ contains integer(psb_ipk_), intent(out) :: info integer(psb_mpk_) :: status(mpi_status_size), minfo minfo = mpi_success -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) flag = .true. #else call mpi_test(node%request,flag,status,minfo) @@ -475,11 +476,11 @@ contains ! ! !!!!!!!!!!!!!!!!! subroutine psi_msnd(ctxt,tag,dest,buffer,mesg_queue) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type) :: ctxt @@ -514,11 +515,11 @@ contains subroutine psi_esnd(ctxt,tag,dest,buffer,mesg_queue) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type) :: ctxt @@ -551,11 +552,11 @@ contains end subroutine psi_esnd subroutine psi_i2snd(ctxt,tag,dest,buffer,mesg_queue) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type) :: ctxt @@ -588,11 +589,11 @@ contains end subroutine psi_i2snd subroutine psi_ssnd(ctxt,tag,dest,buffer,mesg_queue) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type) :: ctxt @@ -625,11 +626,11 @@ contains end subroutine psi_ssnd subroutine psi_dsnd(ctxt,tag,dest,buffer,mesg_queue) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type) :: ctxt @@ -662,11 +663,11 @@ contains end subroutine psi_dsnd subroutine psi_csnd(ctxt,tag,dest,buffer,mesg_queue) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type) :: ctxt @@ -699,11 +700,11 @@ contains end subroutine psi_csnd subroutine psi_zsnd(ctxt,tag,dest,buffer,mesg_queue) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type) :: ctxt @@ -737,11 +738,11 @@ contains subroutine psi_logsnd(ctxt,tag,dest,buffer,mesg_queue) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type) :: ctxt @@ -775,11 +776,11 @@ contains subroutine psi_hsnd(ctxt,tag,dest,buffer,mesg_queue) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type) :: ctxt @@ -850,11 +851,11 @@ contains end subroutine psi_get_sizes subroutine psi_register_mpi_extras(info) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_mpk_) :: info @@ -870,18 +871,18 @@ contains if (info == 0) call mpi_type_create_f90_complex(psb_spk_p_,psb_spk_r_, psb_mpi_c_spk_,info) if (info == 0) call mpi_type_create_f90_complex(psb_dpk_p_,psb_dpk_r_, psb_mpi_c_dpk_,info) #else -#if defined(IPK4) && defined(LPK4) +#if defined(PSB_IPK4) && defined(PSB_LPK4) psb_mpi_ipk_ = mpi_integer4 psb_mpi_lpk_ = mpi_integer4 -#elif defined(IPK4) && defined(LPK8) +#elif defined(PSB_IPK4) && defined(PSB_LPK8) psb_mpi_ipk_ = mpi_integer4 psb_mpi_lpk_ = mpi_integer8 -#elif defined(IPK8) && defined(LPK8) +#elif defined(PSB_IPK8) && defined(PSB_LPK8) psb_mpi_ipk_ = mpi_integer8 psb_mpi_lpk_ = mpi_integer8 #else ! This should never happen - write(psb_err_unit,*) 'Warning: an impossible IPK/LPK combination.' + write(psb_err_unit,*) 'Warning: an impossible PSB_IPK/PSB_LPK combination.' write(psb_err_unit,*) 'Something went wrong at configuration time.' psb_mpi_ipk_ = -1 psb_mpi_lpk_ = -1 @@ -895,7 +896,7 @@ contains psb_mpi_c_dpk_ = mpi_double_complex #endif -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else if (info == 0) call mpi_op_create(psi_i2amx_op,.true.,mpi_i2amx_op,info) if (info == 0) call mpi_op_create(psi_i2amn_op,.true.,mpi_i2amn_op,info) @@ -917,7 +918,7 @@ contains end subroutine psi_register_mpi_extras -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_info_epk(ctxt,iam,np) type(psb_ctxt_type), intent(in) :: ctxt @@ -940,11 +941,11 @@ contains use psb_mat_mod use psb_vect_mod ! !$ use psb_rsb_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(out) :: ctxt @@ -960,7 +961,7 @@ contains ! call psb_set_debug_unit(psb_err_unit) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ctxt%ctxt = nctxt ! allocate on assignment nctxt = nctxt + 1 @@ -1079,11 +1080,11 @@ contains use psb_mat_mod use psb_vect_mod ! !$ use psb_rsb_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(inout) :: ctxt @@ -1108,7 +1109,7 @@ contains ! !$ call psb_error(ctxt) ! !$ endif ! !$ endif -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! Under serial mode, CLOSE has no effect, but reclaim ! the used ctxt number. nctxt = max(0, nctxt - 1) @@ -1153,17 +1154,17 @@ contains subroutine psb_barrier_mpik(ctxt) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt integer(psb_mpk_) :: info -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) if (allocated(ctxt%ctxt)) then if (ctxt%ctxt /= mpi_comm_null) call mpi_barrier(ctxt%ctxt, info) end if @@ -1174,11 +1175,11 @@ contains function psb_wtime() use psb_const_mod ! use mpi_constants -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif real(psb_dpk_) :: psb_wtime @@ -1193,7 +1194,7 @@ contains integer(psb_mpk_) :: code, info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) stop #else if (present(errc)) then @@ -1209,11 +1210,11 @@ contains subroutine psb_info_mpik(ctxt,iam,np) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -1241,7 +1242,7 @@ contains ! it's valid or not. ! -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) iam = 0 np = 1 #else @@ -1268,11 +1269,11 @@ contains function psb_m_get_mpi_comm(ctxt) result(comm) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type) :: ctxt @@ -1290,11 +1291,11 @@ contains end function psb_m_get_mpi_rank subroutine psb_get_mpicomm(ctxt,comm) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type) :: ctxt diff --git a/base/modules/penv/psi_s_collective_mod.F90 b/base/modules/penv/psi_s_collective_mod.F90 index 9f976d79..4eab51ce 100644 --- a/base/modules/penv/psi_s_collective_mod.F90 +++ b/base/modules/penv/psi_s_collective_mod.F90 @@ -102,11 +102,11 @@ contains ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine psb_smaxs(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -121,7 +121,7 @@ contains logical :: collective_start, collective_end, collective_sync real(psb_spk_) :: dat_ -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -176,11 +176,11 @@ contains end subroutine psb_smaxs subroutine psb_smaxv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -196,7 +196,7 @@ contains real(psb_spk_) :: dat_(1) ! This is a dummy -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -255,11 +255,11 @@ contains end subroutine psb_smaxv subroutine psb_smaxm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -275,7 +275,7 @@ contains real(psb_spk_) :: dat_(1,1) ! this is a dummy -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -337,11 +337,11 @@ contains ! MIN: Minimum Value ! subroutine psb_smins(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -355,7 +355,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -411,11 +411,11 @@ contains end subroutine psb_smins subroutine psb_sminv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -429,7 +429,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -488,11 +488,11 @@ contains end subroutine psb_sminv subroutine psb_sminm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -506,7 +506,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -571,11 +571,11 @@ contains ! ! !!!!!!!!!!!! subroutine psb_s_nrm2s(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -589,7 +589,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -648,11 +648,11 @@ contains end subroutine psb_s_nrm2s subroutine psb_s_nrm2v(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -666,7 +666,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -729,11 +729,11 @@ contains ! gather ! subroutine psb_sgather_s(ctxt,dat,resv,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -747,7 +747,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(1) = dat #else call psb_info(ctxt,iam,np) @@ -797,11 +797,11 @@ contains end subroutine psb_sgather_s subroutine psb_sgather_v(ctxt,dat,resv,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -815,7 +815,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(:) = dat(:) #else call psb_info(ctxt,iam,np) @@ -865,11 +865,11 @@ contains end subroutine psb_sgather_v subroutine psb_sgatherv_v(ctxt,dat,resv,szs,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -885,7 +885,7 @@ contains integer(psb_mpk_), allocatable :: displs(:) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(:) = dat(:) #else call psb_info(ctxt,iam,np) @@ -974,11 +974,11 @@ contains ! subroutine psb_ssums(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -992,7 +992,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1050,11 +1050,11 @@ contains end subroutine psb_ssums subroutine psb_ssumv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1068,7 +1068,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1127,11 +1127,11 @@ contains end subroutine psb_ssumv subroutine psb_ssumm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1145,7 +1145,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1208,11 +1208,11 @@ contains ! subroutine psb_samxs(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1226,7 +1226,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1285,11 +1285,11 @@ contains end subroutine psb_samxs subroutine psb_samxv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1303,7 +1303,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1362,11 +1362,11 @@ contains end subroutine psb_samxv subroutine psb_samxm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1380,7 +1380,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1442,11 +1442,11 @@ contains ! AMN: Minimum Absolute Value ! subroutine psb_samns(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1460,7 +1460,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1519,11 +1519,11 @@ contains end subroutine psb_samns subroutine psb_samnv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1537,7 +1537,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1596,11 +1596,11 @@ contains end subroutine psb_samnv subroutine psb_samnm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1614,7 +1614,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1677,11 +1677,11 @@ contains ! BCAST Broadcast ! subroutine psb_sbcasts(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1696,7 +1696,7 @@ contains logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1732,11 +1732,11 @@ contains end subroutine psb_sbcasts subroutine psb_sbcastv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1750,7 +1750,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1787,11 +1787,11 @@ contains end subroutine psb_sbcastv subroutine psb_sbcastm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1805,7 +1805,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1849,11 +1849,11 @@ contains ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine psb_sscan_sums(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1867,7 +1867,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1900,11 +1900,11 @@ contains end subroutine psb_sscan_sums subroutine psb_sexscan_sums(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1919,7 +1919,7 @@ contains logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1954,11 +1954,11 @@ contains end subroutine psb_sexscan_sums subroutine psb_sscan_sumv(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1972,7 +1972,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync real(psb_spk_), allocatable :: dat_(:) -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -2005,11 +2005,11 @@ contains end subroutine psb_sscan_sumv subroutine psb_sexscan_sumv(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -2024,7 +2024,7 @@ contains logical :: collective_start, collective_end, collective_sync real(psb_spk_), allocatable :: dat_(:) -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -2097,11 +2097,11 @@ contains subroutine psb_s_m_simple_triad_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & valrcv,iarcv,jarcv,rvsz,brvindx,ctxt,info) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif real(psb_spk_), intent(in), target :: valsnd(:) @@ -2180,11 +2180,11 @@ contains subroutine psb_s_e_simple_triad_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & valrcv,iarcv,jarcv,rvsz,brvindx,ctxt,info) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif real(psb_spk_), intent(in), target :: valsnd(:) diff --git a/base/modules/penv/psi_s_p2p_mod.F90 b/base/modules/penv/psi_s_p2p_mod.F90 index 9c7f9d66..d8352bd5 100644 --- a/base/modules/penv/psi_s_p2p_mod.F90 +++ b/base/modules/penv/psi_s_p2p_mod.F90 @@ -44,11 +44,11 @@ module psi_s_p2p_mod contains subroutine psb_ssnds(ctxt,dat,dst) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -56,7 +56,7 @@ contains integer(psb_mpk_), intent(in) :: dst real(psb_spk_), allocatable :: dat_(:) integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else allocate(dat_(1), stat=info) @@ -67,11 +67,11 @@ contains subroutine psb_ssndv(ctxt,dat,dst) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -80,7 +80,7 @@ contains real(psb_spk_), allocatable :: dat_(:) integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else allocate(dat_(size(dat)), stat=info) dat_(:) = dat(:) @@ -91,11 +91,11 @@ contains subroutine psb_ssndm(ctxt,dat,dst,m) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -106,7 +106,7 @@ contains integer(psb_ipk_) :: i,j,k,m_,n_ integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else if (present(m)) then m_ = m @@ -127,11 +127,11 @@ contains end subroutine psb_ssndm subroutine psb_srcvs(ctxt,dat,src) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -139,7 +139,7 @@ contains integer(psb_mpk_), intent(in) :: src integer(psb_mpk_) :: info, icomm integer(psb_mpk_) :: status(mpi_status_size) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else icomm = psb_get_mpi_comm(ctxt) @@ -150,11 +150,11 @@ contains subroutine psb_srcvv(ctxt,dat,src) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -163,7 +163,7 @@ contains real(psb_spk_), allocatable :: dat_(:) integer(psb_mpk_) :: info, icomm integer(psb_mpk_) :: status(mpi_status_size) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else icomm = psb_get_mpi_comm(ctxt) call mpi_recv(dat,size(dat),psb_mpi_r_spk_,src,psb_real_tag,icomm,status,info) @@ -174,11 +174,11 @@ contains subroutine psb_srcvm(ctxt,dat,src,m) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -189,7 +189,7 @@ contains integer(psb_mpk_) :: info ,m_,n_, ld, mp_rcv_type integer(psb_mpk_) :: i,j,k integer(psb_mpk_) :: status(mpi_status_size), icomm -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! What should we do here?? #else if (present(m)) then diff --git a/base/modules/penv/psi_z_collective_mod.F90 b/base/modules/penv/psi_z_collective_mod.F90 index 2149669f..fe398c2b 100644 --- a/base/modules/penv/psi_z_collective_mod.F90 +++ b/base/modules/penv/psi_z_collective_mod.F90 @@ -89,11 +89,11 @@ contains ! gather ! subroutine psb_zgather_s(ctxt,dat,resv,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -107,7 +107,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(1) = dat #else call psb_info(ctxt,iam,np) @@ -157,11 +157,11 @@ contains end subroutine psb_zgather_s subroutine psb_zgather_v(ctxt,dat,resv,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -175,7 +175,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(:) = dat(:) #else call psb_info(ctxt,iam,np) @@ -225,11 +225,11 @@ contains end subroutine psb_zgather_v subroutine psb_zgatherv_v(ctxt,dat,resv,szs,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -245,7 +245,7 @@ contains integer(psb_mpk_), allocatable :: displs(:) logical :: collective_start, collective_end, collective_sync -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) resv(:) = dat(:) #else call psb_info(ctxt,iam,np) @@ -334,11 +334,11 @@ contains ! subroutine psb_zsums(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -352,7 +352,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -410,11 +410,11 @@ contains end subroutine psb_zsums subroutine psb_zsumv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -428,7 +428,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -487,11 +487,11 @@ contains end subroutine psb_zsumv subroutine psb_zsumm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -505,7 +505,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -568,11 +568,11 @@ contains ! subroutine psb_zamxs(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -586,7 +586,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -645,11 +645,11 @@ contains end subroutine psb_zamxs subroutine psb_zamxv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -663,7 +663,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -722,11 +722,11 @@ contains end subroutine psb_zamxv subroutine psb_zamxm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -740,7 +740,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -802,11 +802,11 @@ contains ! AMN: Minimum Absolute Value ! subroutine psb_zamns(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -820,7 +820,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -879,11 +879,11 @@ contains end subroutine psb_zamns subroutine psb_zamnv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -897,7 +897,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -956,11 +956,11 @@ contains end subroutine psb_zamnv subroutine psb_zamnm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -974,7 +974,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1037,11 +1037,11 @@ contains ! BCAST Broadcast ! subroutine psb_zbcasts(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1056,7 +1056,7 @@ contains logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1092,11 +1092,11 @@ contains end subroutine psb_zbcasts subroutine psb_zbcastv(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1110,7 +1110,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) if (present(root)) then @@ -1147,11 +1147,11 @@ contains end subroutine psb_zbcastv subroutine psb_zbcastm(ctxt,dat,root,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1165,7 +1165,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) @@ -1209,11 +1209,11 @@ contains ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine psb_zscan_sums(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1227,7 +1227,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1260,11 +1260,11 @@ contains end subroutine psb_zscan_sums subroutine psb_zexscan_sums(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1279,7 +1279,7 @@ contains logical :: collective_start, collective_end, collective_sync -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1314,11 +1314,11 @@ contains end subroutine psb_zexscan_sums subroutine psb_zscan_sumv(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1332,7 +1332,7 @@ contains integer(psb_mpk_) :: status(mpi_status_size) logical :: collective_start, collective_end, collective_sync complex(psb_dpk_), allocatable :: dat_(:) -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1365,11 +1365,11 @@ contains end subroutine psb_zscan_sumv subroutine psb_zexscan_sumv(ctxt,dat,mode,request) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -1384,7 +1384,7 @@ contains logical :: collective_start, collective_end, collective_sync complex(psb_dpk_), allocatable :: dat_(:) -#if !defined(SERIAL_MPI) +#if !defined(PSB_SERIAL_MPI) call psb_info(ctxt,iam,np) icomm = psb_get_mpi_comm(ctxt) if (present(mode)) then @@ -1457,11 +1457,11 @@ contains subroutine psb_z_m_simple_triad_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & valrcv,iarcv,jarcv,rvsz,brvindx,ctxt,info) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif complex(psb_dpk_), intent(in), target :: valsnd(:) @@ -1540,11 +1540,11 @@ contains subroutine psb_z_e_simple_triad_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & valrcv,iarcv,jarcv,rvsz,brvindx,ctxt,info) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif complex(psb_dpk_), intent(in), target :: valsnd(:) diff --git a/base/modules/penv/psi_z_p2p_mod.F90 b/base/modules/penv/psi_z_p2p_mod.F90 index cf12d978..6606d4ed 100644 --- a/base/modules/penv/psi_z_p2p_mod.F90 +++ b/base/modules/penv/psi_z_p2p_mod.F90 @@ -44,11 +44,11 @@ module psi_z_p2p_mod contains subroutine psb_zsnds(ctxt,dat,dst) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -56,7 +56,7 @@ contains integer(psb_mpk_), intent(in) :: dst complex(psb_dpk_), allocatable :: dat_(:) integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else allocate(dat_(1), stat=info) @@ -67,11 +67,11 @@ contains subroutine psb_zsndv(ctxt,dat,dst) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -80,7 +80,7 @@ contains complex(psb_dpk_), allocatable :: dat_(:) integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else allocate(dat_(size(dat)), stat=info) dat_(:) = dat(:) @@ -91,11 +91,11 @@ contains subroutine psb_zsndm(ctxt,dat,dst,m) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -106,7 +106,7 @@ contains integer(psb_ipk_) :: i,j,k,m_,n_ integer(psb_mpk_) :: info -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else if (present(m)) then m_ = m @@ -127,11 +127,11 @@ contains end subroutine psb_zsndm subroutine psb_zrcvs(ctxt,dat,src) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -139,7 +139,7 @@ contains integer(psb_mpk_), intent(in) :: src integer(psb_mpk_) :: info, icomm integer(psb_mpk_) :: status(mpi_status_size) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! do nothing #else icomm = psb_get_mpi_comm(ctxt) @@ -150,11 +150,11 @@ contains subroutine psb_zrcvv(ctxt,dat,src) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -163,7 +163,7 @@ contains complex(psb_dpk_), allocatable :: dat_(:) integer(psb_mpk_) :: info, icomm integer(psb_mpk_) :: status(mpi_status_size) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) #else icomm = psb_get_mpi_comm(ctxt) call mpi_recv(dat,size(dat),psb_mpi_c_dpk_,src,psb_dcomplex_tag,icomm,status,info) @@ -174,11 +174,11 @@ contains subroutine psb_zrcvm(ctxt,dat,src,m) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ctxt_type), intent(in) :: ctxt @@ -189,7 +189,7 @@ contains integer(psb_mpk_) :: info ,m_,n_, ld, mp_rcv_type integer(psb_mpk_) :: i,j,k integer(psb_mpk_) :: status(mpi_status_size), icomm -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) ! What should we do here?? #else if (present(m)) then diff --git a/base/modules/psb_cbind_const_mod.F90 b/base/modules/psb_cbind_const_mod.F90 index a20258ac..a976d55d 100644 --- a/base/modules/psb_cbind_const_mod.F90 +++ b/base/modules/psb_cbind_const_mod.F90 @@ -35,13 +35,13 @@ module psb_cbind_const_mod use psb_const_mod integer, parameter :: psb_c_mpk_ = c_int32_t -#if defined(IPK4) && defined(LPK4) +#if defined(PSB_IPK4) && defined(PSB_LPK4) integer, parameter :: psb_c_ipk_ = c_int32_t integer, parameter :: psb_c_lpk_ = c_int32_t -#elif defined(IPK4) && defined(LPK8) +#elif defined(PSB_IPK4) && defined(PSB_LPK8) integer, parameter :: psb_c_ipk_ = c_int32_t integer, parameter :: psb_c_lpk_ = c_int64_t -#elif defined(IPK8) && defined(LPK8) +#elif defined(PSB_IPK8) && defined(PSB_LPK8) integer, parameter :: psb_c_ipk_ = c_int64_t integer, parameter :: psb_c_lpk_ = c_int64_t #else diff --git a/base/modules/psb_config.h.in b/base/modules/psb_config.h.in index 19c440f6..b91f87aa 100644 --- a/base/modules/psb_config.h.in +++ b/base/modules/psb_config.h.in @@ -15,10 +15,10 @@ @CSERIALMPI@ -@IPKDEF@ -@LPKDEF@ +@PSB_IPKDEF@ +@PSB_LPKDEF@ -@CHAVEOPENMP@ +@CHAVE_OPENMP@ @CHAVEMETIS@ @CINTMETIS@ @@ -37,13 +37,13 @@ typedef int32_t psb_m_t; -#if defined(IPK4) && defined(LPK4) +#if defined(PSB_IPK4) && defined(PSB_LPK4) typedef int32_t psb_i_t; typedef int32_t psb_l_t; -#elif defined(IPK4) && defined(LPK8) +#elif defined(PSB_IPK4) && defined(PSB_LPK8) typedef int32_t psb_i_t; typedef int64_t psb_l_t; -#elif defined(IPK8) && defined(LPK8) +#elif defined(PSB_IPK8) && defined(PSB_LPK8) typedef int64_t psb_i_t; typedef int64_t psb_l_t; #else diff --git a/base/modules/psb_const_mod.F90 b/base/modules/psb_const_mod.F90 index 69f7cfa6..b056d207 100644 --- a/base/modules/psb_const_mod.F90 +++ b/base/modules/psb_const_mod.F90 @@ -70,29 +70,29 @@ module psb_const_mod #endif ! Now for the choices: - ! IPK = integer kind for "local" indices and sizes. + ! PSB_IPK = integer kind for "local" indices and sizes. ! Can be 4 or 8 bytes. - ! LPK = integer kind for "global" indices and sizes. + ! PSB_LPK = integer kind for "global" indices and sizes. ! Can be 4 or 8 bytes. - ! Size must be >= size of IPK + ! Size must be >= size of PSB_IPK ! ! Additional rules: ! 1. MPI related stuff is always MPK ! 2. ctxt,IAM,NP: should we have two versions of everything, ! one with MPK the other with EPK? - ! 3. INFO, ERR_ACT, IERR etc are always IPK + ! 3. INFO, ERR_ACT, IERR etc are always PSB_IPK ! 4. For the array version of things, where it makes sense ! e.g. realloc, snd/receive, define as MPK,EPK and the ! compiler will later pick up the correct version according - ! to what IPK/LPK are mapped onto. + ! to what PSB_IPK/PSB_LPK are mapped onto. ! -#if defined(IPK4) && defined(LPK4) +#if defined(PSB_IPK4) && defined(PSB_LPK4) integer, parameter :: psb_ipk_ = psb_mpk_ integer, parameter :: psb_lpk_ = psb_mpk_ -#elif defined(IPK4) && defined(LPK8) +#elif defined(PSB_IPK4) && defined(PSB_LPK8) integer, parameter :: psb_ipk_ = psb_mpk_ integer, parameter :: psb_lpk_ = psb_epk_ -#elif defined(IPK8) && defined(LPK8) +#elif defined(PSB_IPK8) && defined(PSB_LPK8) integer, parameter :: psb_ipk_ = psb_epk_ integer, parameter :: psb_lpk_ = psb_epk_ #else @@ -107,13 +107,13 @@ module psb_const_mod integer(psb_epk_), save :: psb_sizeof_mp = 4 integer(psb_epk_), save :: psb_sizeof_ep = 8 -#if defined(IPK4) && defined(LPK4) +#if defined(PSB_IPK4) && defined(PSB_LPK4) integer(psb_epk_), save :: psb_sizeof_ip = 4 integer(psb_epk_), save :: psb_sizeof_lp = 4 -#elif defined(IPK4) && defined(LPK8) +#elif defined(PSB_IPK4) && defined(PSB_LPK8) integer(psb_epk_), save :: psb_sizeof_ip = 4 integer(psb_epk_), save :: psb_sizeof_lp = 8 -#elif defined(IPK8) && defined(LPK8) +#elif defined(PSB_IPK8) && defined(PSB_LPK8) integer(psb_epk_), save :: psb_sizeof_ip = 8 integer(psb_epk_), save :: psb_sizeof_lp = 8 #else diff --git a/base/modules/psb_error_impl.F90 b/base/modules/psb_error_impl.F90 index f4308816..adc84a3d 100644 --- a/base/modules/psb_error_impl.F90 +++ b/base/modules/psb_error_impl.F90 @@ -9,7 +9,7 @@ subroutine psb_errcomm_i(ctxt, err) end subroutine psb_errcomm_i -#if defined(IPK8) +#if defined(PSB_IPK8) subroutine psb_errcomm_m(ctxt, err) use psb_error_mod, psb_protect_name => psb_errcomm @@ -105,7 +105,7 @@ subroutine psb_serror() end do end if end if -#if defined(HAVE_FLUSH_STMT) +#if defined(PSB_HAVE_FLUSH_STMT) flush(psb_err_unit) #endif @@ -142,7 +142,7 @@ subroutine psb_perror(ctxt,abrt) call psb_errmsg(psb_err_unit,err_c, r_name, e_e_d, a_e_d,iam) ! write(psb_err_unit,'(50("="))') end do -#if defined(HAVE_FLUSH_STMT) +#if defined(PSB_HAVE_FLUSH_STMT) flush(psb_err_unit) #endif @@ -155,7 +155,7 @@ subroutine psb_perror(ctxt,abrt) do while (psb_get_numerr() > 0) call psb_errpop(err_c, r_name, e_e_d, a_e_d) end do -#if defined(HAVE_FLUSH_STMT) +#if defined(PSB_HAVE_FLUSH_STMT) flush(psb_err_unit) #endif diff --git a/base/modules/psb_error_mod.F90 b/base/modules/psb_error_mod.F90 index 28a73498..d9eae249 100644 --- a/base/modules/psb_error_mod.F90 +++ b/base/modules/psb_error_mod.F90 @@ -100,7 +100,7 @@ module psb_error_mod end interface interface psb_errcomm -#if defined(IPK8) +#if defined(PSB_IPK8) subroutine psb_errcomm_m(ctxt, err) import :: psb_ipk_, psb_mpk_, psb_ctxt_type type(pxb_ctxt_type), intent(in) :: ctxt diff --git a/base/modules/psblas/psb_c_psblas_mod.F90 b/base/modules/psblas/psb_c_psblas_mod.F90 index 591dec09..130159bc 100644 --- a/base/modules/psblas/psb_c_psblas_mod.F90 +++ b/base/modules/psblas/psb_c_psblas_mod.F90 @@ -188,7 +188,7 @@ module psb_c_psblas_mod end function psb_camax_vect end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_genrmi procedure psb_camax, psb_camaxv, psb_camax_vect end interface @@ -272,7 +272,7 @@ module psb_c_psblas_mod end subroutine psb_cmasum end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_genrm1 procedure psb_casum, psb_casumv, psb_casum_vect end interface @@ -335,7 +335,7 @@ module psb_c_psblas_mod end function psb_cnrm2_weightmask_vect end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_norm2 procedure psb_cnrm2, psb_cnrm2v, psb_cnrm2_vect, psb_cnrm2_weight_vect, psb_cnrm2_weightmask_vect end interface @@ -366,7 +366,7 @@ module psb_c_psblas_mod end function psb_cnrmi end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_normi procedure psb_cnrmi end interface @@ -384,7 +384,7 @@ module psb_c_psblas_mod end function psb_cspnrm1 end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_norm1 procedure psb_cspnrm1 end interface diff --git a/base/modules/psblas/psb_d_psblas_mod.F90 b/base/modules/psblas/psb_d_psblas_mod.F90 index b200bc8a..afc3acaf 100644 --- a/base/modules/psblas/psb_d_psblas_mod.F90 +++ b/base/modules/psblas/psb_d_psblas_mod.F90 @@ -188,7 +188,7 @@ module psb_d_psblas_mod end function psb_damax_vect end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_genrmi procedure psb_damax, psb_damaxv, psb_damax_vect end interface @@ -283,7 +283,7 @@ module psb_d_psblas_mod end subroutine psb_dmasum end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_genrm1 procedure psb_dasum, psb_dasumv, psb_dasum_vect end interface @@ -346,7 +346,7 @@ module psb_d_psblas_mod end function psb_dnrm2_weightmask_vect end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_norm2 procedure psb_dnrm2, psb_dnrm2v, psb_dnrm2_vect, psb_dnrm2_weight_vect, psb_dnrm2_weightmask_vect end interface @@ -377,7 +377,7 @@ module psb_d_psblas_mod end function psb_dnrmi end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_normi procedure psb_dnrmi end interface @@ -395,7 +395,7 @@ module psb_d_psblas_mod end function psb_dspnrm1 end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_norm1 procedure psb_dspnrm1 end interface diff --git a/base/modules/psblas/psb_s_psblas_mod.F90 b/base/modules/psblas/psb_s_psblas_mod.F90 index a60da025..6048d023 100644 --- a/base/modules/psblas/psb_s_psblas_mod.F90 +++ b/base/modules/psblas/psb_s_psblas_mod.F90 @@ -188,7 +188,7 @@ module psb_s_psblas_mod end function psb_samax_vect end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_genrmi procedure psb_samax, psb_samaxv, psb_samax_vect end interface @@ -283,7 +283,7 @@ module psb_s_psblas_mod end subroutine psb_smasum end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_genrm1 procedure psb_sasum, psb_sasumv, psb_sasum_vect end interface @@ -346,7 +346,7 @@ module psb_s_psblas_mod end function psb_snrm2_weightmask_vect end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_norm2 procedure psb_snrm2, psb_snrm2v, psb_snrm2_vect, psb_snrm2_weight_vect, psb_snrm2_weightmask_vect end interface @@ -377,7 +377,7 @@ module psb_s_psblas_mod end function psb_snrmi end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_normi procedure psb_snrmi end interface @@ -395,7 +395,7 @@ module psb_s_psblas_mod end function psb_sspnrm1 end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_norm1 procedure psb_sspnrm1 end interface diff --git a/base/modules/psblas/psb_z_psblas_mod.F90 b/base/modules/psblas/psb_z_psblas_mod.F90 index 241df2b9..fd0cc300 100644 --- a/base/modules/psblas/psb_z_psblas_mod.F90 +++ b/base/modules/psblas/psb_z_psblas_mod.F90 @@ -188,7 +188,7 @@ module psb_z_psblas_mod end function psb_zamax_vect end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_genrmi procedure psb_zamax, psb_zamaxv, psb_zamax_vect end interface @@ -272,7 +272,7 @@ module psb_z_psblas_mod end subroutine psb_zmasum end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_genrm1 procedure psb_zasum, psb_zasumv, psb_zasum_vect end interface @@ -335,7 +335,7 @@ module psb_z_psblas_mod end function psb_znrm2_weightmask_vect end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_norm2 procedure psb_znrm2, psb_znrm2v, psb_znrm2_vect, psb_znrm2_weight_vect, psb_znrm2_weightmask_vect end interface @@ -366,7 +366,7 @@ module psb_z_psblas_mod end function psb_znrmi end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_normi procedure psb_znrmi end interface @@ -384,7 +384,7 @@ module psb_z_psblas_mod end function psb_zspnrm1 end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface psb_norm1 procedure psb_zspnrm1 end interface diff --git a/base/modules/serial/psb_base_mat_mod.F90 b/base/modules/serial/psb_base_mat_mod.F90 index 2380fcb2..42d480d8 100644 --- a/base/modules/serial/psb_base_mat_mod.F90 +++ b/base/modules/serial/psb_base_mat_mod.F90 @@ -61,7 +61,7 @@ ! ! We are also introducing the type psb_lbase_sparse_mat. ! The basic difference is in the type -! of the indices, which are PSB_LPK_ so that the entries +! of the indices, which are PSB_PSB_LPK_ so that the entries ! are guaranteed to be able to contain global indices. ! This type only supports data handling and preprocessing, it is ! not supposed to be used for computations. @@ -80,7 +80,7 @@ module psb_base_mat_mod integer(psb_ipk_), parameter :: spspmm_serial_rb_tree = 3 integer(psb_ipk_), parameter :: spspmm_omp_rb_tree = 4 integer(psb_ipk_), parameter :: spspmm_omp_two_pass = 5 -#if defined(OPENMP) +#if defined(PSB_OPENMP) integer(psb_ipk_), save :: spspmm_impl = spspmm_omp_gustavson #else integer(psb_ipk_), save :: spspmm_impl = spspmm_serial @@ -564,7 +564,7 @@ module psb_base_mat_mod ! == = ================================= procedure, pass(a) :: set_lnrows => psb_lbase_set_lnrows procedure, pass(a) :: set_lncols => psb_lbase_set_lncols -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) procedure, pass(a) :: set_inrows => psb_lbase_set_inrows procedure, pass(a) :: set_incols => psb_lbase_set_incols generic, public :: set_nrows => set_lnrows, set_inrows @@ -601,7 +601,7 @@ module psb_base_mat_mod procedure, pass(a) :: reinit => psb_lbase_reinit procedure, pass(a) :: allocate_mnnz => psb_lbase_allocate_mnnz procedure, pass(a) :: reallocate_nz => psb_lbase_reallocate_nz -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) procedure, pass(a) :: allocate_imnnz => psb_lbase_allocate_imnnz procedure, pass(a) :: reallocate_inz => psb_lbase_reallocate_inz generic, public :: allocate => allocate_mnnz, allocate_imnnz @@ -1433,7 +1433,7 @@ contains a%n = n end subroutine psb_lbase_set_lncols -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_lbase_allocate_imnnz(m,n,a,nz) implicit none integer(psb_ipk_), intent(in) :: m,n diff --git a/base/modules/serial/psb_c_base_mat_mod.F90 b/base/modules/serial/psb_c_base_mat_mod.F90 index 33982e3a..a5537034 100644 --- a/base/modules/serial/psb_c_base_mat_mod.F90 +++ b/base/modules/serial/psb_c_base_mat_mod.F90 @@ -416,7 +416,7 @@ module psb_c_base_mat_mod ! ! This is COO specific ! -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) procedure, pass(a) :: iset_nzeros => lc_coo_iset_nzeros procedure, pass(a) :: lset_nzeros => lc_coo_lset_nzeros generic, public :: set_nzeros => iset_nzeros, lset_nzeros @@ -439,7 +439,7 @@ module psb_c_base_mat_mod private :: lc_coo_get_nzeros, lc_coo_iset_nzeros, & & lc_coo_get_fmt, lc_coo_free, lc_coo_sizeof, & & lc_coo_transp_1mat, lc_coo_transc_1mat -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) private :: lc_coo_lset_nzeros #endif @@ -3499,7 +3499,7 @@ module psb_c_base_mat_mod end subroutine psb_lc_coo_clean_negidx end interface -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) ! !> Funtion: coo_clean_negidx_inner !! \brief Take out any entries with negative row or column index @@ -4323,7 +4323,7 @@ contains end subroutine lc_coo_iset_nzeros -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine lc_coo_lset_nzeros(nz,a) implicit none integer(psb_lpk_), intent(in) :: nz diff --git a/base/modules/serial/psb_c_base_vect_mod.F90 b/base/modules/serial/psb_c_base_vect_mod.F90 index 4dac86d6..eac61c75 100644 --- a/base/modules/serial/psb_c_base_vect_mod.F90 +++ b/base/modules/serial/psb_c_base_vect_mod.F90 @@ -276,7 +276,7 @@ contains call psb_errpush(psb_err_alloc_dealloc_,'base_vect_bld') return end if -#if defined (OPENMP) +#if defined (PSB_OPENMP) !$omp parallel do private(i) do i = 1, size(this) x%v(i) = this(i) @@ -841,7 +841,7 @@ contains if (present(last)) last_ = min(last,last_) if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i = first_, last_ x%v(i) = val @@ -879,7 +879,7 @@ contains if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i = first_, last_ x%v(i) = val(i-first_+1) @@ -928,7 +928,7 @@ contains if (allocated(x%v)) then if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i=1, size(x%v) x%v(i) = abs(x%v(i)) @@ -1735,7 +1735,7 @@ contains integer(psb_ipk_) :: i if (allocated(x%v)) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i=1,size(x%v) x%v(i) = alpha*x%v(i) @@ -1779,7 +1779,7 @@ contains integer(psb_ipk_) :: i if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) res = szero !$omp parallel do private(i) reduction(max: res) do i=1, n @@ -1804,7 +1804,7 @@ contains integer(psb_ipk_) :: i if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) res=szero !$omp parallel do private(i) reduction(+: res) do i= 1, size(x%v) @@ -2019,7 +2019,7 @@ contains integer(psb_ipk_) :: i, n if (z%is_dev()) call z%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) n = size(x) !$omp parallel do private(i) do i = 1, n diff --git a/base/modules/serial/psb_c_mat_mod.F90 b/base/modules/serial/psb_c_mat_mod.F90 index e7c84b00..165a5451 100644 --- a/base/modules/serial/psb_c_mat_mod.F90 +++ b/base/modules/serial/psb_c_mat_mod.F90 @@ -71,7 +71,7 @@ ! ! We are also introducing the type psb_lcspmat_type. ! The basic difference with psb_cspmat_type is in the type -! of the indices, which are PSB_LPK_ so that the entries +! of the indices, which are PSB_PSB_LPK_ so that the entries ! are guaranteed to be able to contain global indices. ! This type only supports data handling and preprocessing, it is ! not supposed to be used for computations. @@ -145,7 +145,7 @@ module psb_c_mat_mod procedure, pass(a) :: csgetrow => psb_c_csgetrow procedure, pass(a) :: csgetblk => psb_c_csgetblk generic, public :: csget => csgetptn, csgetrow, csgetblk -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) procedure, pass(a) :: lcsgetptn => psb_c_lcsgetptn procedure, pass(a) :: lcsgetrow => psb_c_lcsgetrow generic, public :: csget => lcsgetptn, lcsgetrow @@ -311,7 +311,7 @@ module psb_c_mat_mod ! Setters procedure, pass(a) :: set_lnrows => psb_lc_set_lnrows procedure, pass(a) :: set_lncols => psb_lc_set_lncols -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) procedure, pass(a) :: set_inrows => psb_lc_set_inrows procedure, pass(a) :: set_incols => psb_lc_set_incols generic, public :: set_nrows => set_inrows, set_lnrows @@ -346,7 +346,7 @@ module psb_c_mat_mod procedure, pass(a) :: csgetrow => psb_lc_csgetrow procedure, pass(a) :: csgetblk => psb_lc_csgetblk generic, public :: csget => csgetptn, csgetrow, csgetblk -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) !!$ procedure, pass(a) :: icsgetptn => psb_lc_icsgetptn !!$ procedure, pass(a) :: icsgetrow => psb_lc_icsgetrow !!$ generic, public :: csget => icsgetptn, icsgetrow @@ -1270,7 +1270,7 @@ module psb_c_mat_mod class(psb_lcspmat_type), intent(inout) :: a integer(psb_lpk_), intent(in) :: m end subroutine psb_lc_set_lnrows -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_lc_set_inrows(m,a) import :: psb_ipk_, psb_lpk_, psb_lcspmat_type class(psb_lcspmat_type), intent(inout) :: a @@ -1285,7 +1285,7 @@ module psb_c_mat_mod class(psb_lcspmat_type), intent(inout) :: a integer(psb_lpk_), intent(in) :: n end subroutine psb_lc_set_lncols -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_lc_set_incols(n,a) import :: psb_ipk_, psb_lpk_, psb_lcspmat_type class(psb_lcspmat_type), intent(inout) :: a @@ -2410,7 +2410,7 @@ contains end subroutine psb_c_clean_zeros -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_c_lcsgetptn(imin,imax,a,nz,ia,ja,info,& & jmin,jmax,iren,append,nzin,rscale,cscale) implicit none @@ -2929,7 +2929,7 @@ contains end subroutine psb_lc_clean_zeros -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) !!$ subroutine psb_lc_icsgetptn(imin,imax,a,nz,ia,ja,info,& !!$ & jmin,jmax,iren,append,nzin,rscale,cscale) !!$ implicit none diff --git a/base/modules/serial/psb_d_base_mat_mod.F90 b/base/modules/serial/psb_d_base_mat_mod.F90 index 5f4c76df..b2f49f2d 100644 --- a/base/modules/serial/psb_d_base_mat_mod.F90 +++ b/base/modules/serial/psb_d_base_mat_mod.F90 @@ -416,7 +416,7 @@ module psb_d_base_mat_mod ! ! This is COO specific ! -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) procedure, pass(a) :: iset_nzeros => ld_coo_iset_nzeros procedure, pass(a) :: lset_nzeros => ld_coo_lset_nzeros generic, public :: set_nzeros => iset_nzeros, lset_nzeros @@ -439,7 +439,7 @@ module psb_d_base_mat_mod private :: ld_coo_get_nzeros, ld_coo_iset_nzeros, & & ld_coo_get_fmt, ld_coo_free, ld_coo_sizeof, & & ld_coo_transp_1mat, ld_coo_transc_1mat -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) private :: ld_coo_lset_nzeros #endif @@ -3499,7 +3499,7 @@ module psb_d_base_mat_mod end subroutine psb_ld_coo_clean_negidx end interface -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) ! !> Funtion: coo_clean_negidx_inner !! \brief Take out any entries with negative row or column index @@ -4323,7 +4323,7 @@ contains end subroutine ld_coo_iset_nzeros -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine ld_coo_lset_nzeros(nz,a) implicit none integer(psb_lpk_), intent(in) :: nz diff --git a/base/modules/serial/psb_d_base_vect_mod.F90 b/base/modules/serial/psb_d_base_vect_mod.F90 index f07b5aed..c7bd08a2 100644 --- a/base/modules/serial/psb_d_base_vect_mod.F90 +++ b/base/modules/serial/psb_d_base_vect_mod.F90 @@ -283,7 +283,7 @@ contains call psb_errpush(psb_err_alloc_dealloc_,'base_vect_bld') return end if -#if defined (OPENMP) +#if defined (PSB_OPENMP) !$omp parallel do private(i) do i = 1, size(this) x%v(i) = this(i) @@ -848,7 +848,7 @@ contains if (present(last)) last_ = min(last,last_) if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i = first_, last_ x%v(i) = val @@ -886,7 +886,7 @@ contains if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i = first_, last_ x%v(i) = val(i-first_+1) @@ -935,7 +935,7 @@ contains if (allocated(x%v)) then if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i=1, size(x%v) x%v(i) = abs(x%v(i)) @@ -1742,7 +1742,7 @@ contains integer(psb_ipk_) :: i if (allocated(x%v)) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i=1,size(x%v) x%v(i) = alpha*x%v(i) @@ -1786,7 +1786,7 @@ contains integer(psb_ipk_) :: i if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) res = dzero !$omp parallel do private(i) reduction(max: res) do i=1, n @@ -1810,7 +1810,7 @@ contains integer(psb_ipk_) :: i if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) res = HUGE(done) !$omp parallel do private(i) reduction(min: res) do i=1, n @@ -1891,7 +1891,7 @@ contains integer(psb_ipk_) :: i if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) res=dzero !$omp parallel do private(i) reduction(+: res) do i= 1, size(x%v) @@ -2198,7 +2198,7 @@ contains integer(psb_ipk_) :: i, n if (z%is_dev()) call z%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) n = size(x) !$omp parallel do private(i) do i = 1, n diff --git a/base/modules/serial/psb_d_mat_mod.F90 b/base/modules/serial/psb_d_mat_mod.F90 index fe09d83a..a4318ba4 100644 --- a/base/modules/serial/psb_d_mat_mod.F90 +++ b/base/modules/serial/psb_d_mat_mod.F90 @@ -71,7 +71,7 @@ ! ! We are also introducing the type psb_ldspmat_type. ! The basic difference with psb_dspmat_type is in the type -! of the indices, which are PSB_LPK_ so that the entries +! of the indices, which are PSB_PSB_LPK_ so that the entries ! are guaranteed to be able to contain global indices. ! This type only supports data handling and preprocessing, it is ! not supposed to be used for computations. @@ -145,7 +145,7 @@ module psb_d_mat_mod procedure, pass(a) :: csgetrow => psb_d_csgetrow procedure, pass(a) :: csgetblk => psb_d_csgetblk generic, public :: csget => csgetptn, csgetrow, csgetblk -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) procedure, pass(a) :: lcsgetptn => psb_d_lcsgetptn procedure, pass(a) :: lcsgetrow => psb_d_lcsgetrow generic, public :: csget => lcsgetptn, lcsgetrow @@ -311,7 +311,7 @@ module psb_d_mat_mod ! Setters procedure, pass(a) :: set_lnrows => psb_ld_set_lnrows procedure, pass(a) :: set_lncols => psb_ld_set_lncols -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) procedure, pass(a) :: set_inrows => psb_ld_set_inrows procedure, pass(a) :: set_incols => psb_ld_set_incols generic, public :: set_nrows => set_inrows, set_lnrows @@ -346,7 +346,7 @@ module psb_d_mat_mod procedure, pass(a) :: csgetrow => psb_ld_csgetrow procedure, pass(a) :: csgetblk => psb_ld_csgetblk generic, public :: csget => csgetptn, csgetrow, csgetblk -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) !!$ procedure, pass(a) :: icsgetptn => psb_ld_icsgetptn !!$ procedure, pass(a) :: icsgetrow => psb_ld_icsgetrow !!$ generic, public :: csget => icsgetptn, icsgetrow @@ -1270,7 +1270,7 @@ module psb_d_mat_mod class(psb_ldspmat_type), intent(inout) :: a integer(psb_lpk_), intent(in) :: m end subroutine psb_ld_set_lnrows -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_ld_set_inrows(m,a) import :: psb_ipk_, psb_lpk_, psb_ldspmat_type class(psb_ldspmat_type), intent(inout) :: a @@ -1285,7 +1285,7 @@ module psb_d_mat_mod class(psb_ldspmat_type), intent(inout) :: a integer(psb_lpk_), intent(in) :: n end subroutine psb_ld_set_lncols -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_ld_set_incols(n,a) import :: psb_ipk_, psb_lpk_, psb_ldspmat_type class(psb_ldspmat_type), intent(inout) :: a @@ -2410,7 +2410,7 @@ contains end subroutine psb_d_clean_zeros -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_d_lcsgetptn(imin,imax,a,nz,ia,ja,info,& & jmin,jmax,iren,append,nzin,rscale,cscale) implicit none @@ -2929,7 +2929,7 @@ contains end subroutine psb_ld_clean_zeros -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) !!$ subroutine psb_ld_icsgetptn(imin,imax,a,nz,ia,ja,info,& !!$ & jmin,jmax,iren,append,nzin,rscale,cscale) !!$ implicit none diff --git a/base/modules/serial/psb_i_base_vect_mod.F90 b/base/modules/serial/psb_i_base_vect_mod.F90 index a5cddeb5..466a9a0f 100644 --- a/base/modules/serial/psb_i_base_vect_mod.F90 +++ b/base/modules/serial/psb_i_base_vect_mod.F90 @@ -209,7 +209,7 @@ contains call psb_errpush(psb_err_alloc_dealloc_,'base_vect_bld') return end if -#if defined (OPENMP) +#if defined (PSB_OPENMP) !$omp parallel do private(i) do i = 1, size(this) x%v(i) = this(i) @@ -774,7 +774,7 @@ contains if (present(last)) last_ = min(last,last_) if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i = first_, last_ x%v(i) = val @@ -812,7 +812,7 @@ contains if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i = first_, last_ x%v(i) = val(i-first_+1) diff --git a/base/modules/serial/psb_l_base_vect_mod.F90 b/base/modules/serial/psb_l_base_vect_mod.F90 index 93b29e17..4c14e6d1 100644 --- a/base/modules/serial/psb_l_base_vect_mod.F90 +++ b/base/modules/serial/psb_l_base_vect_mod.F90 @@ -210,7 +210,7 @@ contains call psb_errpush(psb_err_alloc_dealloc_,'base_vect_bld') return end if -#if defined (OPENMP) +#if defined (PSB_OPENMP) !$omp parallel do private(i) do i = 1, size(this) x%v(i) = this(i) @@ -775,7 +775,7 @@ contains if (present(last)) last_ = min(last,last_) if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i = first_, last_ x%v(i) = val @@ -813,7 +813,7 @@ contains if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i = first_, last_ x%v(i) = val(i-first_+1) diff --git a/base/modules/serial/psb_s_base_mat_mod.F90 b/base/modules/serial/psb_s_base_mat_mod.F90 index 92bda7d8..27803e0f 100644 --- a/base/modules/serial/psb_s_base_mat_mod.F90 +++ b/base/modules/serial/psb_s_base_mat_mod.F90 @@ -416,7 +416,7 @@ module psb_s_base_mat_mod ! ! This is COO specific ! -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) procedure, pass(a) :: iset_nzeros => ls_coo_iset_nzeros procedure, pass(a) :: lset_nzeros => ls_coo_lset_nzeros generic, public :: set_nzeros => iset_nzeros, lset_nzeros @@ -439,7 +439,7 @@ module psb_s_base_mat_mod private :: ls_coo_get_nzeros, ls_coo_iset_nzeros, & & ls_coo_get_fmt, ls_coo_free, ls_coo_sizeof, & & ls_coo_transp_1mat, ls_coo_transc_1mat -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) private :: ls_coo_lset_nzeros #endif @@ -3499,7 +3499,7 @@ module psb_s_base_mat_mod end subroutine psb_ls_coo_clean_negidx end interface -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) ! !> Funtion: coo_clean_negidx_inner !! \brief Take out any entries with negative row or column index @@ -4323,7 +4323,7 @@ contains end subroutine ls_coo_iset_nzeros -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine ls_coo_lset_nzeros(nz,a) implicit none integer(psb_lpk_), intent(in) :: nz diff --git a/base/modules/serial/psb_s_base_vect_mod.F90 b/base/modules/serial/psb_s_base_vect_mod.F90 index 596cd634..2d1b03b7 100644 --- a/base/modules/serial/psb_s_base_vect_mod.F90 +++ b/base/modules/serial/psb_s_base_vect_mod.F90 @@ -283,7 +283,7 @@ contains call psb_errpush(psb_err_alloc_dealloc_,'base_vect_bld') return end if -#if defined (OPENMP) +#if defined (PSB_OPENMP) !$omp parallel do private(i) do i = 1, size(this) x%v(i) = this(i) @@ -848,7 +848,7 @@ contains if (present(last)) last_ = min(last,last_) if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i = first_, last_ x%v(i) = val @@ -886,7 +886,7 @@ contains if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i = first_, last_ x%v(i) = val(i-first_+1) @@ -935,7 +935,7 @@ contains if (allocated(x%v)) then if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i=1, size(x%v) x%v(i) = abs(x%v(i)) @@ -1742,7 +1742,7 @@ contains integer(psb_ipk_) :: i if (allocated(x%v)) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i=1,size(x%v) x%v(i) = alpha*x%v(i) @@ -1786,7 +1786,7 @@ contains integer(psb_ipk_) :: i if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) res = szero !$omp parallel do private(i) reduction(max: res) do i=1, n @@ -1810,7 +1810,7 @@ contains integer(psb_ipk_) :: i if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) res = HUGE(sone) !$omp parallel do private(i) reduction(min: res) do i=1, n @@ -1891,7 +1891,7 @@ contains integer(psb_ipk_) :: i if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) res=szero !$omp parallel do private(i) reduction(+: res) do i= 1, size(x%v) @@ -2198,7 +2198,7 @@ contains integer(psb_ipk_) :: i, n if (z%is_dev()) call z%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) n = size(x) !$omp parallel do private(i) do i = 1, n diff --git a/base/modules/serial/psb_s_mat_mod.F90 b/base/modules/serial/psb_s_mat_mod.F90 index 868583b2..e342ed8c 100644 --- a/base/modules/serial/psb_s_mat_mod.F90 +++ b/base/modules/serial/psb_s_mat_mod.F90 @@ -71,7 +71,7 @@ ! ! We are also introducing the type psb_lsspmat_type. ! The basic difference with psb_sspmat_type is in the type -! of the indices, which are PSB_LPK_ so that the entries +! of the indices, which are PSB_PSB_LPK_ so that the entries ! are guaranteed to be able to contain global indices. ! This type only supports data handling and preprocessing, it is ! not supposed to be used for computations. @@ -145,7 +145,7 @@ module psb_s_mat_mod procedure, pass(a) :: csgetrow => psb_s_csgetrow procedure, pass(a) :: csgetblk => psb_s_csgetblk generic, public :: csget => csgetptn, csgetrow, csgetblk -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) procedure, pass(a) :: lcsgetptn => psb_s_lcsgetptn procedure, pass(a) :: lcsgetrow => psb_s_lcsgetrow generic, public :: csget => lcsgetptn, lcsgetrow @@ -311,7 +311,7 @@ module psb_s_mat_mod ! Setters procedure, pass(a) :: set_lnrows => psb_ls_set_lnrows procedure, pass(a) :: set_lncols => psb_ls_set_lncols -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) procedure, pass(a) :: set_inrows => psb_ls_set_inrows procedure, pass(a) :: set_incols => psb_ls_set_incols generic, public :: set_nrows => set_inrows, set_lnrows @@ -346,7 +346,7 @@ module psb_s_mat_mod procedure, pass(a) :: csgetrow => psb_ls_csgetrow procedure, pass(a) :: csgetblk => psb_ls_csgetblk generic, public :: csget => csgetptn, csgetrow, csgetblk -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) !!$ procedure, pass(a) :: icsgetptn => psb_ls_icsgetptn !!$ procedure, pass(a) :: icsgetrow => psb_ls_icsgetrow !!$ generic, public :: csget => icsgetptn, icsgetrow @@ -1270,7 +1270,7 @@ module psb_s_mat_mod class(psb_lsspmat_type), intent(inout) :: a integer(psb_lpk_), intent(in) :: m end subroutine psb_ls_set_lnrows -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_ls_set_inrows(m,a) import :: psb_ipk_, psb_lpk_, psb_lsspmat_type class(psb_lsspmat_type), intent(inout) :: a @@ -1285,7 +1285,7 @@ module psb_s_mat_mod class(psb_lsspmat_type), intent(inout) :: a integer(psb_lpk_), intent(in) :: n end subroutine psb_ls_set_lncols -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_ls_set_incols(n,a) import :: psb_ipk_, psb_lpk_, psb_lsspmat_type class(psb_lsspmat_type), intent(inout) :: a @@ -2410,7 +2410,7 @@ contains end subroutine psb_s_clean_zeros -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_s_lcsgetptn(imin,imax,a,nz,ia,ja,info,& & jmin,jmax,iren,append,nzin,rscale,cscale) implicit none @@ -2929,7 +2929,7 @@ contains end subroutine psb_ls_clean_zeros -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) !!$ subroutine psb_ls_icsgetptn(imin,imax,a,nz,ia,ja,info,& !!$ & jmin,jmax,iren,append,nzin,rscale,cscale) !!$ implicit none diff --git a/base/modules/serial/psb_z_base_mat_mod.F90 b/base/modules/serial/psb_z_base_mat_mod.F90 index 3e8196f4..0d2c9e76 100644 --- a/base/modules/serial/psb_z_base_mat_mod.F90 +++ b/base/modules/serial/psb_z_base_mat_mod.F90 @@ -416,7 +416,7 @@ module psb_z_base_mat_mod ! ! This is COO specific ! -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) procedure, pass(a) :: iset_nzeros => lz_coo_iset_nzeros procedure, pass(a) :: lset_nzeros => lz_coo_lset_nzeros generic, public :: set_nzeros => iset_nzeros, lset_nzeros @@ -439,7 +439,7 @@ module psb_z_base_mat_mod private :: lz_coo_get_nzeros, lz_coo_iset_nzeros, & & lz_coo_get_fmt, lz_coo_free, lz_coo_sizeof, & & lz_coo_transp_1mat, lz_coo_transc_1mat -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) private :: lz_coo_lset_nzeros #endif @@ -3499,7 +3499,7 @@ module psb_z_base_mat_mod end subroutine psb_lz_coo_clean_negidx end interface -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) ! !> Funtion: coo_clean_negidx_inner !! \brief Take out any entries with negative row or column index @@ -4323,7 +4323,7 @@ contains end subroutine lz_coo_iset_nzeros -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine lz_coo_lset_nzeros(nz,a) implicit none integer(psb_lpk_), intent(in) :: nz diff --git a/base/modules/serial/psb_z_base_vect_mod.F90 b/base/modules/serial/psb_z_base_vect_mod.F90 index 1bbdfba1..5a55cdc6 100644 --- a/base/modules/serial/psb_z_base_vect_mod.F90 +++ b/base/modules/serial/psb_z_base_vect_mod.F90 @@ -276,7 +276,7 @@ contains call psb_errpush(psb_err_alloc_dealloc_,'base_vect_bld') return end if -#if defined (OPENMP) +#if defined (PSB_OPENMP) !$omp parallel do private(i) do i = 1, size(this) x%v(i) = this(i) @@ -841,7 +841,7 @@ contains if (present(last)) last_ = min(last,last_) if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i = first_, last_ x%v(i) = val @@ -879,7 +879,7 @@ contains if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i = first_, last_ x%v(i) = val(i-first_+1) @@ -928,7 +928,7 @@ contains if (allocated(x%v)) then if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i=1, size(x%v) x%v(i) = abs(x%v(i)) @@ -1735,7 +1735,7 @@ contains integer(psb_ipk_) :: i if (allocated(x%v)) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do private(i) do i=1,size(x%v) x%v(i) = alpha*x%v(i) @@ -1779,7 +1779,7 @@ contains integer(psb_ipk_) :: i if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) res = dzero !$omp parallel do private(i) reduction(max: res) do i=1, n @@ -1804,7 +1804,7 @@ contains integer(psb_ipk_) :: i if (x%is_dev()) call x%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) res=dzero !$omp parallel do private(i) reduction(+: res) do i= 1, size(x%v) @@ -2019,7 +2019,7 @@ contains integer(psb_ipk_) :: i, n if (z%is_dev()) call z%sync() -#if defined(OPENMP) +#if defined(PSB_OPENMP) n = size(x) !$omp parallel do private(i) do i = 1, n diff --git a/base/modules/serial/psb_z_mat_mod.F90 b/base/modules/serial/psb_z_mat_mod.F90 index 48b670de..47342aee 100644 --- a/base/modules/serial/psb_z_mat_mod.F90 +++ b/base/modules/serial/psb_z_mat_mod.F90 @@ -71,7 +71,7 @@ ! ! We are also introducing the type psb_lzspmat_type. ! The basic difference with psb_zspmat_type is in the type -! of the indices, which are PSB_LPK_ so that the entries +! of the indices, which are PSB_PSB_LPK_ so that the entries ! are guaranteed to be able to contain global indices. ! This type only supports data handling and preprocessing, it is ! not supposed to be used for computations. @@ -145,7 +145,7 @@ module psb_z_mat_mod procedure, pass(a) :: csgetrow => psb_z_csgetrow procedure, pass(a) :: csgetblk => psb_z_csgetblk generic, public :: csget => csgetptn, csgetrow, csgetblk -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) procedure, pass(a) :: lcsgetptn => psb_z_lcsgetptn procedure, pass(a) :: lcsgetrow => psb_z_lcsgetrow generic, public :: csget => lcsgetptn, lcsgetrow @@ -311,7 +311,7 @@ module psb_z_mat_mod ! Setters procedure, pass(a) :: set_lnrows => psb_lz_set_lnrows procedure, pass(a) :: set_lncols => psb_lz_set_lncols -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) procedure, pass(a) :: set_inrows => psb_lz_set_inrows procedure, pass(a) :: set_incols => psb_lz_set_incols generic, public :: set_nrows => set_inrows, set_lnrows @@ -346,7 +346,7 @@ module psb_z_mat_mod procedure, pass(a) :: csgetrow => psb_lz_csgetrow procedure, pass(a) :: csgetblk => psb_lz_csgetblk generic, public :: csget => csgetptn, csgetrow, csgetblk -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) !!$ procedure, pass(a) :: icsgetptn => psb_lz_icsgetptn !!$ procedure, pass(a) :: icsgetrow => psb_lz_icsgetrow !!$ generic, public :: csget => icsgetptn, icsgetrow @@ -1270,7 +1270,7 @@ module psb_z_mat_mod class(psb_lzspmat_type), intent(inout) :: a integer(psb_lpk_), intent(in) :: m end subroutine psb_lz_set_lnrows -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_lz_set_inrows(m,a) import :: psb_ipk_, psb_lpk_, psb_lzspmat_type class(psb_lzspmat_type), intent(inout) :: a @@ -1285,7 +1285,7 @@ module psb_z_mat_mod class(psb_lzspmat_type), intent(inout) :: a integer(psb_lpk_), intent(in) :: n end subroutine psb_lz_set_lncols -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_lz_set_incols(n,a) import :: psb_ipk_, psb_lpk_, psb_lzspmat_type class(psb_lzspmat_type), intent(inout) :: a @@ -2410,7 +2410,7 @@ contains end subroutine psb_z_clean_zeros -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_z_lcsgetptn(imin,imax,a,nz,ia,ja,info,& & jmin,jmax,iren,append,nzin,rscale,cscale) implicit none @@ -2929,7 +2929,7 @@ contains end subroutine psb_lz_clean_zeros -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) !!$ subroutine psb_lz_icsgetptn(imin,imax,a,nz,ia,ja,info,& !!$ & jmin,jmax,iren,append,nzin,rscale,cscale) !!$ implicit none diff --git a/base/modules/tools/psb_c_tools_mod.F90 b/base/modules/tools/psb_c_tools_mod.F90 index 0ed2d82c..97ee169f 100644 --- a/base/modules/tools/psb_c_tools_mod.F90 +++ b/base/modules/tools/psb_c_tools_mod.F90 @@ -309,7 +309,7 @@ Module psb_c_tools_mod integer(psb_ipk_), intent(out) :: info logical, intent(in), optional :: rebuild, local end subroutine psb_cspins_csr_lirp -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_cspins_csr_iirp(nr,irw,irp,ja,val,a,desc_a,info,rebuild,local) import implicit none diff --git a/base/modules/tools/psb_cd_tools_mod.F90 b/base/modules/tools/psb_cd_tools_mod.F90 index 8912e96a..579b6d5f 100644 --- a/base/modules/tools/psb_cd_tools_mod.F90 +++ b/base/modules/tools/psb_cd_tools_mod.F90 @@ -104,7 +104,7 @@ module psb_cd_tools_mod end interface interface psb_cdins -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_cdinsrc(nz,ia,ja,desc_a,info,ila,jla) import :: psb_ipk_, psb_lpk_, psb_desc_type type(psb_desc_type), intent(inout) :: desc_a diff --git a/base/modules/tools/psb_d_tools_mod.F90 b/base/modules/tools/psb_d_tools_mod.F90 index 26f83201..b2ac3a66 100644 --- a/base/modules/tools/psb_d_tools_mod.F90 +++ b/base/modules/tools/psb_d_tools_mod.F90 @@ -309,7 +309,7 @@ Module psb_d_tools_mod integer(psb_ipk_), intent(out) :: info logical, intent(in), optional :: rebuild, local end subroutine psb_dspins_csr_lirp -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_dspins_csr_iirp(nr,irw,irp,ja,val,a,desc_a,info,rebuild,local) import implicit none diff --git a/base/modules/tools/psb_s_tools_mod.F90 b/base/modules/tools/psb_s_tools_mod.F90 index 0f70a31a..18addeda 100644 --- a/base/modules/tools/psb_s_tools_mod.F90 +++ b/base/modules/tools/psb_s_tools_mod.F90 @@ -309,7 +309,7 @@ Module psb_s_tools_mod integer(psb_ipk_), intent(out) :: info logical, intent(in), optional :: rebuild, local end subroutine psb_sspins_csr_lirp -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_sspins_csr_iirp(nr,irw,irp,ja,val,a,desc_a,info,rebuild,local) import implicit none diff --git a/base/modules/tools/psb_z_tools_mod.F90 b/base/modules/tools/psb_z_tools_mod.F90 index 1f24e05a..fd9d5e22 100644 --- a/base/modules/tools/psb_z_tools_mod.F90 +++ b/base/modules/tools/psb_z_tools_mod.F90 @@ -309,7 +309,7 @@ Module psb_z_tools_mod integer(psb_ipk_), intent(out) :: info logical, intent(in), optional :: rebuild, local end subroutine psb_zspins_csr_lirp -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_zspins_csr_iirp(nr,irw,irp,ja,val,a,desc_a,info,rebuild,local) import implicit none diff --git a/base/psblas/psb_cgetmatinfo.F90 b/base/psblas/psb_cgetmatinfo.F90 index b560fb60..66db7693 100644 --- a/base/psblas/psb_cgetmatinfo.F90 +++ b/base/psblas/psb_cgetmatinfo.F90 @@ -37,11 +37,11 @@ function psb_cget_nnz(a,desc_a,info) result(res) use psb_base_mod, psb_protect_name => psb_cget_nnz use psi_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/psblas/psb_cspmm.f90 b/base/psblas/psb_cspmm.f90 index 22c6408f..0f18dc86 100644 --- a/base/psblas/psb_cspmm.f90 +++ b/base/psblas/psb_cspmm.f90 @@ -599,7 +599,7 @@ subroutine psb_cspmm(alpha,a,x,beta,y,desc_a,info,& if (doswap_)then ik = lik ! This should not be an issue, we are expecting the values - ! to be small, within IPK + ! to be small, within PSB_IPK call psi_swaptran(ior(psb_swap_send_,psb_swap_recv_),& & ik,cone,y(:,1:ik),desc_a,iwork,info) if (info == psb_success_) call psi_swapdata(ior(psb_swap_send_,psb_swap_recv_),& diff --git a/base/psblas/psb_cspsm.f90 b/base/psblas/psb_cspsm.f90 index da99b8e9..3b948ea0 100644 --- a/base/psblas/psb_cspsm.f90 +++ b/base/psblas/psb_cspsm.f90 @@ -447,7 +447,7 @@ subroutine psb_cspsm(alpha,a,x,beta,y,desc_a,info,& end if ik = lik ! This should not be a problem. - ! We expect ik to be small, well within IPK + ! We expect ik to be small, well within PSB_IPK ! Perform local triangular system solve xp => x(iix:lldx,jjx:jjx+ik-1) yp => y(iiy:lldy,jjy:jjy+ik-1) diff --git a/base/psblas/psb_dgetmatinfo.F90 b/base/psblas/psb_dgetmatinfo.F90 index abc50d36..9b327011 100644 --- a/base/psblas/psb_dgetmatinfo.F90 +++ b/base/psblas/psb_dgetmatinfo.F90 @@ -37,11 +37,11 @@ function psb_dget_nnz(a,desc_a,info) result(res) use psb_base_mod, psb_protect_name => psb_dget_nnz use psi_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/psblas/psb_dspmm.f90 b/base/psblas/psb_dspmm.f90 index fa256276..dc022cc4 100644 --- a/base/psblas/psb_dspmm.f90 +++ b/base/psblas/psb_dspmm.f90 @@ -599,7 +599,7 @@ subroutine psb_dspmm(alpha,a,x,beta,y,desc_a,info,& if (doswap_)then ik = lik ! This should not be an issue, we are expecting the values - ! to be small, within IPK + ! to be small, within PSB_IPK call psi_swaptran(ior(psb_swap_send_,psb_swap_recv_),& & ik,done,y(:,1:ik),desc_a,iwork,info) if (info == psb_success_) call psi_swapdata(ior(psb_swap_send_,psb_swap_recv_),& diff --git a/base/psblas/psb_dspsm.f90 b/base/psblas/psb_dspsm.f90 index 9e5eeafc..2b0774d9 100644 --- a/base/psblas/psb_dspsm.f90 +++ b/base/psblas/psb_dspsm.f90 @@ -447,7 +447,7 @@ subroutine psb_dspsm(alpha,a,x,beta,y,desc_a,info,& end if ik = lik ! This should not be a problem. - ! We expect ik to be small, well within IPK + ! We expect ik to be small, well within PSB_IPK ! Perform local triangular system solve xp => x(iix:lldx,jjx:jjx+ik-1) yp => y(iiy:lldy,jjy:jjy+ik-1) diff --git a/base/psblas/psb_sgetmatinfo.F90 b/base/psblas/psb_sgetmatinfo.F90 index 8b54318d..5d5ae9c4 100644 --- a/base/psblas/psb_sgetmatinfo.F90 +++ b/base/psblas/psb_sgetmatinfo.F90 @@ -37,11 +37,11 @@ function psb_sget_nnz(a,desc_a,info) result(res) use psb_base_mod, psb_protect_name => psb_sget_nnz use psi_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/psblas/psb_sspmm.f90 b/base/psblas/psb_sspmm.f90 index 6c723831..e6fbaab9 100644 --- a/base/psblas/psb_sspmm.f90 +++ b/base/psblas/psb_sspmm.f90 @@ -599,7 +599,7 @@ subroutine psb_sspmm(alpha,a,x,beta,y,desc_a,info,& if (doswap_)then ik = lik ! This should not be an issue, we are expecting the values - ! to be small, within IPK + ! to be small, within PSB_IPK call psi_swaptran(ior(psb_swap_send_,psb_swap_recv_),& & ik,sone,y(:,1:ik),desc_a,iwork,info) if (info == psb_success_) call psi_swapdata(ior(psb_swap_send_,psb_swap_recv_),& diff --git a/base/psblas/psb_sspsm.f90 b/base/psblas/psb_sspsm.f90 index 522d4bd9..4c23cdba 100644 --- a/base/psblas/psb_sspsm.f90 +++ b/base/psblas/psb_sspsm.f90 @@ -447,7 +447,7 @@ subroutine psb_sspsm(alpha,a,x,beta,y,desc_a,info,& end if ik = lik ! This should not be a problem. - ! We expect ik to be small, well within IPK + ! We expect ik to be small, well within PSB_IPK ! Perform local triangular system solve xp => x(iix:lldx,jjx:jjx+ik-1) yp => y(iiy:lldy,jjy:jjy+ik-1) diff --git a/base/psblas/psb_zgetmatinfo.F90 b/base/psblas/psb_zgetmatinfo.F90 index 999ed1a6..7cc3bfae 100644 --- a/base/psblas/psb_zgetmatinfo.F90 +++ b/base/psblas/psb_zgetmatinfo.F90 @@ -37,11 +37,11 @@ function psb_zget_nnz(a,desc_a,info) result(res) use psb_base_mod, psb_protect_name => psb_zget_nnz use psi_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/psblas/psb_zspmm.f90 b/base/psblas/psb_zspmm.f90 index 179e4fad..9309c417 100644 --- a/base/psblas/psb_zspmm.f90 +++ b/base/psblas/psb_zspmm.f90 @@ -599,7 +599,7 @@ subroutine psb_zspmm(alpha,a,x,beta,y,desc_a,info,& if (doswap_)then ik = lik ! This should not be an issue, we are expecting the values - ! to be small, within IPK + ! to be small, within PSB_IPK call psi_swaptran(ior(psb_swap_send_,psb_swap_recv_),& & ik,zone,y(:,1:ik),desc_a,iwork,info) if (info == psb_success_) call psi_swapdata(ior(psb_swap_send_,psb_swap_recv_),& diff --git a/base/psblas/psb_zspsm.f90 b/base/psblas/psb_zspsm.f90 index 80fbfb56..c42408da 100644 --- a/base/psblas/psb_zspsm.f90 +++ b/base/psblas/psb_zspsm.f90 @@ -447,7 +447,7 @@ subroutine psb_zspsm(alpha,a,x,beta,y,desc_a,info,& end if ik = lik ! This should not be a problem. - ! We expect ik to be small, well within IPK + ! We expect ik to be small, well within PSB_IPK ! Perform local triangular system solve xp => x(iix:lldx,jjx:jjx+ik-1) yp => y(iiy:lldy,jjy:jjy+ik-1) diff --git a/base/serial/impl/psb_c_coo_impl.F90 b/base/serial/impl/psb_c_coo_impl.F90 index 86280f2d..1b162457 100644 --- a/base/serial/impl/psb_c_coo_impl.F90 +++ b/base/serial/impl/psb_c_coo_impl.F90 @@ -257,7 +257,7 @@ subroutine psb_c_coo_spaxpby(alpha,a,beta,b,info) ! Allocate (temporary) space for the solution call tcoo%allocate(M,N,(nza+nzb)) ! Compute the sum -#if defined (OPENMP) +#if defined (PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -368,7 +368,7 @@ function psb_c_coo_cmpmat(a,b,tol,info) result(res) ! Allocate (temporary) space for the solution call tcoo%allocate(M,N,(nza+nzb)) ! Compute the sum -#if defined (OPENMP) +#if defined (PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -1930,7 +1930,7 @@ function psb_c_coo_maxval(a) result(res) nnz = a%get_nzeros() if (allocated(a%val)) then nnz = min(nnz,size(a%val)) -#if defined(OPENMP) +#if defined(PSB_OPENMP) res = szero !$omp parallel do private(i) reduction(max: res) do i=1, nnz @@ -2820,7 +2820,7 @@ subroutine psb_c_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) use psb_realloc_mod use psb_sort_mod use psb_c_base_mat_mod, psb_protect_name => psb_c_coo_csput_a -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -2869,29 +2869,42 @@ subroutine psb_c_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) if (a%is_bld()) then ! Structure here is peculiar, because this function can be called ! either within a parallel region, or outside. - ! Hence the call to set_nzeros done here. - !$omp critical + ! Hence the call to set_nzeros done here. +#if defined(PSB_OPENMP) + !$omp critical(c_coo_csput_a) +#endif nza = a%get_nzeros() nzaold = nza isza = a%get_size() + if (info /= 0) write(0,*) name,' point 0:',info,isza,nza,nz ! Build phase. Must handle reallocations in a sensible way. if (isza < (nza+nz)) then + write(0,*) ' before reallocate in csput ',psb_errstatus_fatal(),info call a%reallocate(max(nza+nz,int(1.5*isza))) + write(0,*) ' after reallocate in csput ',psb_errstatus_fatal(),info endif isza = a%get_size() if (isza < (nza+nz)) then - info = psb_err_alloc_dealloc_; call psb_errpush(info,name) + info = psb_err_alloc_dealloc_; + write(0,*) name,' point 1:',info,isza,nza,nz,nza+nz + call psb_errpush(info,name) else -#if defined(OPENMP) +#if defined(PSB_OPENMP) nza = nza + nz #endif call a%set_nzeros(nza) end if - !$omp end critical - if (info /= 0) goto 9999 +#if defined(PSB_OPENMP) + if (info /= 0) write(0,*) name,' point 1.5:',info + !$omp end critical(c_coo_csput_a) +#endif + if (info /= 0) then + write(0,*) name,' point 2:',info + goto 9999 + end if call psb_inner_ins(nz,ia,ja,val,nzaold,a%ia,a%ja,a%val,isza,& & imin,imax,jmin,jmax,info) -#if !defined(OPENMP) +#if !defined(PSB_OPENMP) nza = nzaold call a%set_nzeros(nza) #endif @@ -2946,7 +2959,7 @@ contains integer(psb_ipk_) :: i,ir,ic info = psb_success_ -#if defined(OPENMP) +#if defined(PSB_OPENMP) ! Disabling OpenMP parallel do for the time being. ! Will need to redesign the entire code stack ! The logic here is different from the one used for @@ -3133,7 +3146,7 @@ subroutine psb_c_cp_coo_to_coo(a,b,info) call b%set_nzeros(nz) call b%reallocate(nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -3186,7 +3199,7 @@ subroutine psb_c_cp_coo_from_coo(a,b,info) call a%set_nzeros(nz) call a%reallocate(nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -3572,7 +3585,7 @@ subroutine psb_c_coo_tril(a,l,info,& nb = jmax_ endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_), allocatable :: lrws(:),urws(:) integer(psb_ipk_) :: lpnt, upnt, lnz, unz @@ -3868,7 +3881,7 @@ subroutine psb_c_coo_triu(a,u,info,& nb = jmax_ endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_), allocatable :: lrws(:),urws(:) integer(psb_ipk_) :: lpnt, upnt, lnz, unz @@ -4158,7 +4171,7 @@ subroutine psb_c_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) use psb_string_mod use psb_ip_reord_mod use psb_sort_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -4176,7 +4189,7 @@ subroutine psb_c_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name = 'psb_fixcoo' logical :: srt_inp, use_buffers -#if defined(OPENMP) +#if defined(PSB_OPENMP) integer(psb_ipk_) :: work,idxstart,idxend,first_elem,last_elem,s,nthreads,ithread integer(psb_ipk_) :: saved_elem,old_val,nxt_val,err,act_row,act_col,maxthreads #endif @@ -4204,7 +4217,7 @@ subroutine psb_c_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) dupl_ = dupl -#if defined(OPENMP) +#if defined(PSB_OPENMP) maxthreads = omp_get_max_threads() ! 'iaux' has to allow the threads to have an exclusive group ! of indices as work space. Since each thread handles one @@ -4260,7 +4273,7 @@ subroutine psb_c_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf use psb_string_mod use psb_ip_reord_mod use psb_sort_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -4278,7 +4291,7 @@ subroutine psb_c_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf character(len=20) :: name = 'psb_fixcoo' logical :: srt_inp, use_buffers real(psb_dpk_) :: t0, t1 -#if defined(OPENMP) +#if defined(PSB_OPENMP) integer(psb_ipk_) :: work,idxstart,idxend,first_elem,last_elem,s,nthreads,ithread integer(psb_ipk_) :: saved_elem,old_val,nxt_val,err,act_row,act_col,maxthreads integer(psb_ipk_), allocatable :: kaux(:),idxaux(:) @@ -4293,7 +4306,7 @@ subroutine psb_c_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf ! Row major order if (nr <= nzin) then ! Avoid strange situations with large indices -#if defined(OPENMP) +#if defined(PSB_OPENMP) ! We are not going to need 'ix2' because of the presence ! of 'idxaux' as auxiliary buffer. allocate(ias(nzin),jas(nzin),vs(nzin), stat=info) @@ -4306,7 +4319,7 @@ subroutine psb_c_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf end if !if (use_buffers) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp workshare iaux(:) = 0 !$omp end workshare @@ -4360,7 +4373,7 @@ subroutine psb_c_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf ! all the indices are valid ! Check again use_buffers. if (use_buffers) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) maxthreads = omp_get_max_threads() allocate(kaux(nr+1),idxaux(MAX(nc+2,nr+2)),stat=info) if (info /= psb_success_) then @@ -4734,7 +4747,7 @@ subroutine psb_c_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf call psi_msort_up(nzin,ia(1:),iaux(1:),iret) if (iret == 0) & & call psb_ip_reord(nzin,val,ia,ja,iaux) -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP PARALLEL & !$OMP shared(nr,nc,nzin,iaux,ia,ja,val,nthreads,maxnzr) & !$OMP private(i,j,idxstart,idxend,nzl,act_row,iret,ithread, & @@ -4924,7 +4937,7 @@ subroutine psb_c_cp_coo_to_lcoo(a,b,info) call b%set_nzeros(nz) call b%reallocate(nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -4976,7 +4989,7 @@ subroutine psb_c_cp_coo_from_lcoo(a,b,info) call a%set_nzeros(nz) call a%reallocate(nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -5189,7 +5202,7 @@ function psb_lc_coo_maxval(a) result(res) nnz = a%get_nzeros() if (allocated(a%val)) then nnz = min(nnz,size(a%val)) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) reduction(max:res) @@ -5256,7 +5269,7 @@ function psb_lc_coo_csnmi(a) result(res) i = a%ia(j) vt(i) = vt(i) + abs(a%val(j)) end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) reduction(max:res) @@ -5306,7 +5319,7 @@ function psb_lc_coo_csnm1(a) result(res) i = a%ja(j) vt(i) = vt(i) + abs(a%val(j)) end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) reduction(max:res) @@ -5589,7 +5602,7 @@ subroutine psb_lc_coo_spaxpby(alpha,a,beta,b,info) ! Allocate (temporary) space for the solution call tcoo%allocate(M,N,(nza+nzb)) ! Compute the sum -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -5700,7 +5713,7 @@ function psb_lc_coo_cmpmat(a,b,tol,info) result(res) ! Allocate (temporary) space for the solution call tcoo%allocate(M,N,(nza+nzb)) ! Compute the sum -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -5961,7 +5974,7 @@ subroutine psb_lc_coo_clean_negidx(a,info) end subroutine psb_lc_coo_clean_negidx -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_lc_coo_clean_negidx_inner(nzin,ia,ja,val,nzout,info) use psb_error_mod use psb_c_base_mat_mod, psb_protect_name => psb_lc_coo_clean_negidx_inner diff --git a/base/serial/impl/psb_c_csc_impl.F90 b/base/serial/impl/psb_c_csc_impl.F90 index 787334ab..94744dcf 100644 --- a/base/serial/impl/psb_c_csc_impl.F90 +++ b/base/serial/impl/psb_c_csc_impl.F90 @@ -2189,7 +2189,7 @@ subroutine psb_c_mv_csc_from_coo(a,b,info) use psb_error_mod use psb_c_base_mat_mod use psb_c_csc_mat_mod, psb_protect_name => psb_c_mv_csc_from_coo -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -2226,7 +2226,7 @@ subroutine psb_c_mv_csc_from_coo(a,b,info) call psb_realloc(nc+1,a%icp,info) call b%free() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP PARALLEL default(shared) diff --git a/base/serial/impl/psb_c_csr_impl.F90 b/base/serial/impl/psb_c_csr_impl.F90 index 6fde6980..5a795583 100644 --- a/base/serial/impl/psb_c_csr_impl.F90 +++ b/base/serial/impl/psb_c_csr_impl.F90 @@ -2289,7 +2289,7 @@ subroutine psb_c_csr_tril(a,l,info,& nb = jmax_ endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_), allocatable :: lrws(:),urws(:) integer(psb_ipk_) :: lpnt, upnt, lnz, unz @@ -2591,7 +2591,7 @@ subroutine psb_c_csr_triu(a,u,info,& endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_), allocatable :: lrws(:),urws(:) integer(psb_ipk_) :: lpnt, upnt, lnz, unz @@ -3156,7 +3156,7 @@ subroutine psb_c_cp_csr_from_coo(a,b,info) use psb_realloc_mod use psb_c_base_mat_mod use psb_c_csr_mat_mod, psb_protect_name => psb_c_cp_csr_from_coo -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -3217,7 +3217,7 @@ subroutine psb_c_cp_csr_from_coo(a,b,info) endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP PARALLEL default(shared) reduction(max:info) @@ -3346,7 +3346,7 @@ subroutine psb_c_mv_csr_from_coo(a,b,info) use psb_error_mod use psb_c_base_mat_mod use psb_c_csr_mat_mod, psb_protect_name => psb_c_mv_csr_from_coo -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -3385,7 +3385,7 @@ subroutine psb_c_mv_csr_from_coo(a,b,info) call psb_realloc(max(nr+1,nc+1),a%irp,info) call b%free() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP PARALLEL default(shared) reduction(max:info) @@ -3655,7 +3655,7 @@ end subroutine psb_c_cp_csr_from_fmt !!$ call a%set_host() !!$end subroutine psb_c_csr_clean_zeros -#if defined(OPENMP) +#if defined(PSB_OPENMP) subroutine psb_ccsrspspmm(a,b,c,info) use psb_c_mat_mod use psb_serial_mod, psb_protect_name => psb_ccsrspspmm diff --git a/base/serial/impl/psb_c_mat_impl.F90 b/base/serial/impl/psb_c_mat_impl.F90 index 532cb9b8..81479084 100644 --- a/base/serial/impl/psb_c_mat_impl.F90 +++ b/base/serial/impl/psb_c_mat_impl.F90 @@ -3111,7 +3111,7 @@ subroutine psb_lc_set_lnrows(m,a) end subroutine psb_lc_set_lnrows -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_lc_set_inrows(m,a) use psb_c_mat_mod, psb_protect_name => psb_lc_set_inrows use psb_error_mod @@ -3168,7 +3168,7 @@ subroutine psb_lc_set_lncols(n,a) end subroutine psb_lc_set_lncols -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_lc_set_incols(n,a) use psb_c_mat_mod, psb_protect_name => psb_lc_set_incols use psb_error_mod diff --git a/base/serial/impl/psb_c_rb_idx_tree_impl.F90 b/base/serial/impl/psb_c_rb_idx_tree_impl.F90 index 42704c6e..04730aaa 100644 --- a/base/serial/impl/psb_c_rb_idx_tree_impl.F90 +++ b/base/serial/impl/psb_c_rb_idx_tree_impl.F90 @@ -267,7 +267,7 @@ subroutine psb_c_rb_idx_tree_scalar_sparse_row_mul(tree, scalar, mat, row_num) end subroutine psb_c_rb_idx_tree_scalar_sparse_row_mul subroutine psb_c_rb_idx_tree_merge(trees, mat) -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif use psb_realloc_mod @@ -294,7 +294,7 @@ subroutine psb_c_rb_idx_tree_merge(trees, mat) call psb_realloc(nnz, mat%val, info) call psb_realloc(nnz, mat%ja, info) -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do schedule(static), private(current, previous, j) #endif do i = 1, size(trees) @@ -323,7 +323,7 @@ subroutine psb_c_rb_idx_tree_merge(trees, mat) deallocate(previous) end do end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp end parallel do #endif end subroutine psb_c_rb_idx_tree_merge diff --git a/base/serial/impl/psb_d_coo_impl.F90 b/base/serial/impl/psb_d_coo_impl.F90 index 5d5dc7b4..9a20164a 100644 --- a/base/serial/impl/psb_d_coo_impl.F90 +++ b/base/serial/impl/psb_d_coo_impl.F90 @@ -257,7 +257,7 @@ subroutine psb_d_coo_spaxpby(alpha,a,beta,b,info) ! Allocate (temporary) space for the solution call tcoo%allocate(M,N,(nza+nzb)) ! Compute the sum -#if defined (OPENMP) +#if defined (PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -368,7 +368,7 @@ function psb_d_coo_cmpmat(a,b,tol,info) result(res) ! Allocate (temporary) space for the solution call tcoo%allocate(M,N,(nza+nzb)) ! Compute the sum -#if defined (OPENMP) +#if defined (PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -1930,7 +1930,7 @@ function psb_d_coo_maxval(a) result(res) nnz = a%get_nzeros() if (allocated(a%val)) then nnz = min(nnz,size(a%val)) -#if defined(OPENMP) +#if defined(PSB_OPENMP) res = dzero !$omp parallel do private(i) reduction(max: res) do i=1, nnz @@ -2820,7 +2820,7 @@ subroutine psb_d_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) use psb_realloc_mod use psb_sort_mod use psb_d_base_mat_mod, psb_protect_name => psb_d_coo_csput_a -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -2869,29 +2869,42 @@ subroutine psb_d_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) if (a%is_bld()) then ! Structure here is peculiar, because this function can be called ! either within a parallel region, or outside. - ! Hence the call to set_nzeros done here. - !$omp critical + ! Hence the call to set_nzeros done here. +#if defined(PSB_OPENMP) + !$omp critical(d_coo_csput_a) +#endif nza = a%get_nzeros() nzaold = nza isza = a%get_size() + if (info /= 0) write(0,*) name,' point 0:',info,isza,nza,nz ! Build phase. Must handle reallocations in a sensible way. if (isza < (nza+nz)) then + write(0,*) ' before reallocate in csput ',psb_errstatus_fatal(),info call a%reallocate(max(nza+nz,int(1.5*isza))) + write(0,*) ' after reallocate in csput ',psb_errstatus_fatal(),info endif isza = a%get_size() if (isza < (nza+nz)) then - info = psb_err_alloc_dealloc_; call psb_errpush(info,name) + info = psb_err_alloc_dealloc_; + write(0,*) name,' point 1:',info,isza,nza,nz,nza+nz + call psb_errpush(info,name) else -#if defined(OPENMP) +#if defined(PSB_OPENMP) nza = nza + nz #endif call a%set_nzeros(nza) end if - !$omp end critical - if (info /= 0) goto 9999 +#if defined(PSB_OPENMP) + if (info /= 0) write(0,*) name,' point 1.5:',info + !$omp end critical(d_coo_csput_a) +#endif + if (info /= 0) then + write(0,*) name,' point 2:',info + goto 9999 + end if call psb_inner_ins(nz,ia,ja,val,nzaold,a%ia,a%ja,a%val,isza,& & imin,imax,jmin,jmax,info) -#if !defined(OPENMP) +#if !defined(PSB_OPENMP) nza = nzaold call a%set_nzeros(nza) #endif @@ -2946,7 +2959,7 @@ contains integer(psb_ipk_) :: i,ir,ic info = psb_success_ -#if defined(OPENMP) +#if defined(PSB_OPENMP) ! Disabling OpenMP parallel do for the time being. ! Will need to redesign the entire code stack ! The logic here is different from the one used for @@ -3133,7 +3146,7 @@ subroutine psb_d_cp_coo_to_coo(a,b,info) call b%set_nzeros(nz) call b%reallocate(nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -3186,7 +3199,7 @@ subroutine psb_d_cp_coo_from_coo(a,b,info) call a%set_nzeros(nz) call a%reallocate(nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -3572,7 +3585,7 @@ subroutine psb_d_coo_tril(a,l,info,& nb = jmax_ endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_), allocatable :: lrws(:),urws(:) integer(psb_ipk_) :: lpnt, upnt, lnz, unz @@ -3868,7 +3881,7 @@ subroutine psb_d_coo_triu(a,u,info,& nb = jmax_ endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_), allocatable :: lrws(:),urws(:) integer(psb_ipk_) :: lpnt, upnt, lnz, unz @@ -4158,7 +4171,7 @@ subroutine psb_d_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) use psb_string_mod use psb_ip_reord_mod use psb_sort_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -4176,7 +4189,7 @@ subroutine psb_d_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name = 'psb_fixcoo' logical :: srt_inp, use_buffers -#if defined(OPENMP) +#if defined(PSB_OPENMP) integer(psb_ipk_) :: work,idxstart,idxend,first_elem,last_elem,s,nthreads,ithread integer(psb_ipk_) :: saved_elem,old_val,nxt_val,err,act_row,act_col,maxthreads #endif @@ -4204,7 +4217,7 @@ subroutine psb_d_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) dupl_ = dupl -#if defined(OPENMP) +#if defined(PSB_OPENMP) maxthreads = omp_get_max_threads() ! 'iaux' has to allow the threads to have an exclusive group ! of indices as work space. Since each thread handles one @@ -4260,7 +4273,7 @@ subroutine psb_d_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf use psb_string_mod use psb_ip_reord_mod use psb_sort_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -4278,7 +4291,7 @@ subroutine psb_d_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf character(len=20) :: name = 'psb_fixcoo' logical :: srt_inp, use_buffers real(psb_dpk_) :: t0, t1 -#if defined(OPENMP) +#if defined(PSB_OPENMP) integer(psb_ipk_) :: work,idxstart,idxend,first_elem,last_elem,s,nthreads,ithread integer(psb_ipk_) :: saved_elem,old_val,nxt_val,err,act_row,act_col,maxthreads integer(psb_ipk_), allocatable :: kaux(:),idxaux(:) @@ -4293,7 +4306,7 @@ subroutine psb_d_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf ! Row major order if (nr <= nzin) then ! Avoid strange situations with large indices -#if defined(OPENMP) +#if defined(PSB_OPENMP) ! We are not going to need 'ix2' because of the presence ! of 'idxaux' as auxiliary buffer. allocate(ias(nzin),jas(nzin),vs(nzin), stat=info) @@ -4306,7 +4319,7 @@ subroutine psb_d_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf end if !if (use_buffers) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp workshare iaux(:) = 0 !$omp end workshare @@ -4360,7 +4373,7 @@ subroutine psb_d_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf ! all the indices are valid ! Check again use_buffers. if (use_buffers) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) maxthreads = omp_get_max_threads() allocate(kaux(nr+1),idxaux(MAX(nc+2,nr+2)),stat=info) if (info /= psb_success_) then @@ -4734,7 +4747,7 @@ subroutine psb_d_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf call psi_msort_up(nzin,ia(1:),iaux(1:),iret) if (iret == 0) & & call psb_ip_reord(nzin,val,ia,ja,iaux) -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP PARALLEL & !$OMP shared(nr,nc,nzin,iaux,ia,ja,val,nthreads,maxnzr) & !$OMP private(i,j,idxstart,idxend,nzl,act_row,iret,ithread, & @@ -4924,7 +4937,7 @@ subroutine psb_d_cp_coo_to_lcoo(a,b,info) call b%set_nzeros(nz) call b%reallocate(nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -4976,7 +4989,7 @@ subroutine psb_d_cp_coo_from_lcoo(a,b,info) call a%set_nzeros(nz) call a%reallocate(nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -5189,7 +5202,7 @@ function psb_ld_coo_maxval(a) result(res) nnz = a%get_nzeros() if (allocated(a%val)) then nnz = min(nnz,size(a%val)) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) reduction(max:res) @@ -5256,7 +5269,7 @@ function psb_ld_coo_csnmi(a) result(res) i = a%ia(j) vt(i) = vt(i) + abs(a%val(j)) end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) reduction(max:res) @@ -5306,7 +5319,7 @@ function psb_ld_coo_csnm1(a) result(res) i = a%ja(j) vt(i) = vt(i) + abs(a%val(j)) end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) reduction(max:res) @@ -5589,7 +5602,7 @@ subroutine psb_ld_coo_spaxpby(alpha,a,beta,b,info) ! Allocate (temporary) space for the solution call tcoo%allocate(M,N,(nza+nzb)) ! Compute the sum -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -5700,7 +5713,7 @@ function psb_ld_coo_cmpmat(a,b,tol,info) result(res) ! Allocate (temporary) space for the solution call tcoo%allocate(M,N,(nza+nzb)) ! Compute the sum -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -5961,7 +5974,7 @@ subroutine psb_ld_coo_clean_negidx(a,info) end subroutine psb_ld_coo_clean_negidx -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_ld_coo_clean_negidx_inner(nzin,ia,ja,val,nzout,info) use psb_error_mod use psb_d_base_mat_mod, psb_protect_name => psb_ld_coo_clean_negidx_inner diff --git a/base/serial/impl/psb_d_csc_impl.F90 b/base/serial/impl/psb_d_csc_impl.F90 index 129d2a73..ba38e763 100644 --- a/base/serial/impl/psb_d_csc_impl.F90 +++ b/base/serial/impl/psb_d_csc_impl.F90 @@ -2189,7 +2189,7 @@ subroutine psb_d_mv_csc_from_coo(a,b,info) use psb_error_mod use psb_d_base_mat_mod use psb_d_csc_mat_mod, psb_protect_name => psb_d_mv_csc_from_coo -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -2226,7 +2226,7 @@ subroutine psb_d_mv_csc_from_coo(a,b,info) call psb_realloc(nc+1,a%icp,info) call b%free() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP PARALLEL default(shared) diff --git a/base/serial/impl/psb_d_csr_impl.F90 b/base/serial/impl/psb_d_csr_impl.F90 index d2651e0b..af842c16 100644 --- a/base/serial/impl/psb_d_csr_impl.F90 +++ b/base/serial/impl/psb_d_csr_impl.F90 @@ -2289,7 +2289,7 @@ subroutine psb_d_csr_tril(a,l,info,& nb = jmax_ endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_), allocatable :: lrws(:),urws(:) integer(psb_ipk_) :: lpnt, upnt, lnz, unz @@ -2591,7 +2591,7 @@ subroutine psb_d_csr_triu(a,u,info,& endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_), allocatable :: lrws(:),urws(:) integer(psb_ipk_) :: lpnt, upnt, lnz, unz @@ -3156,7 +3156,7 @@ subroutine psb_d_cp_csr_from_coo(a,b,info) use psb_realloc_mod use psb_d_base_mat_mod use psb_d_csr_mat_mod, psb_protect_name => psb_d_cp_csr_from_coo -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -3217,7 +3217,7 @@ subroutine psb_d_cp_csr_from_coo(a,b,info) endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP PARALLEL default(shared) reduction(max:info) @@ -3346,7 +3346,7 @@ subroutine psb_d_mv_csr_from_coo(a,b,info) use psb_error_mod use psb_d_base_mat_mod use psb_d_csr_mat_mod, psb_protect_name => psb_d_mv_csr_from_coo -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -3385,7 +3385,7 @@ subroutine psb_d_mv_csr_from_coo(a,b,info) call psb_realloc(max(nr+1,nc+1),a%irp,info) call b%free() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP PARALLEL default(shared) reduction(max:info) @@ -3655,7 +3655,7 @@ end subroutine psb_d_cp_csr_from_fmt !!$ call a%set_host() !!$end subroutine psb_d_csr_clean_zeros -#if defined(OPENMP) +#if defined(PSB_OPENMP) subroutine psb_dcsrspspmm(a,b,c,info) use psb_d_mat_mod use psb_serial_mod, psb_protect_name => psb_dcsrspspmm diff --git a/base/serial/impl/psb_d_mat_impl.F90 b/base/serial/impl/psb_d_mat_impl.F90 index e48654ce..c744f7f5 100644 --- a/base/serial/impl/psb_d_mat_impl.F90 +++ b/base/serial/impl/psb_d_mat_impl.F90 @@ -3111,7 +3111,7 @@ subroutine psb_ld_set_lnrows(m,a) end subroutine psb_ld_set_lnrows -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_ld_set_inrows(m,a) use psb_d_mat_mod, psb_protect_name => psb_ld_set_inrows use psb_error_mod @@ -3168,7 +3168,7 @@ subroutine psb_ld_set_lncols(n,a) end subroutine psb_ld_set_lncols -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_ld_set_incols(n,a) use psb_d_mat_mod, psb_protect_name => psb_ld_set_incols use psb_error_mod diff --git a/base/serial/impl/psb_d_rb_idx_tree_impl.F90 b/base/serial/impl/psb_d_rb_idx_tree_impl.F90 index 9b63d51c..241338fb 100644 --- a/base/serial/impl/psb_d_rb_idx_tree_impl.F90 +++ b/base/serial/impl/psb_d_rb_idx_tree_impl.F90 @@ -267,7 +267,7 @@ subroutine psb_d_rb_idx_tree_scalar_sparse_row_mul(tree, scalar, mat, row_num) end subroutine psb_d_rb_idx_tree_scalar_sparse_row_mul subroutine psb_d_rb_idx_tree_merge(trees, mat) -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif use psb_realloc_mod @@ -294,7 +294,7 @@ subroutine psb_d_rb_idx_tree_merge(trees, mat) call psb_realloc(nnz, mat%val, info) call psb_realloc(nnz, mat%ja, info) -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do schedule(static), private(current, previous, j) #endif do i = 1, size(trees) @@ -323,7 +323,7 @@ subroutine psb_d_rb_idx_tree_merge(trees, mat) deallocate(previous) end do end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp end parallel do #endif end subroutine psb_d_rb_idx_tree_merge diff --git a/base/serial/impl/psb_s_coo_impl.F90 b/base/serial/impl/psb_s_coo_impl.F90 index a16b2067..e944ce7c 100644 --- a/base/serial/impl/psb_s_coo_impl.F90 +++ b/base/serial/impl/psb_s_coo_impl.F90 @@ -257,7 +257,7 @@ subroutine psb_s_coo_spaxpby(alpha,a,beta,b,info) ! Allocate (temporary) space for the solution call tcoo%allocate(M,N,(nza+nzb)) ! Compute the sum -#if defined (OPENMP) +#if defined (PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -368,7 +368,7 @@ function psb_s_coo_cmpmat(a,b,tol,info) result(res) ! Allocate (temporary) space for the solution call tcoo%allocate(M,N,(nza+nzb)) ! Compute the sum -#if defined (OPENMP) +#if defined (PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -1930,7 +1930,7 @@ function psb_s_coo_maxval(a) result(res) nnz = a%get_nzeros() if (allocated(a%val)) then nnz = min(nnz,size(a%val)) -#if defined(OPENMP) +#if defined(PSB_OPENMP) res = szero !$omp parallel do private(i) reduction(max: res) do i=1, nnz @@ -2820,7 +2820,7 @@ subroutine psb_s_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) use psb_realloc_mod use psb_sort_mod use psb_s_base_mat_mod, psb_protect_name => psb_s_coo_csput_a -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -2869,29 +2869,42 @@ subroutine psb_s_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) if (a%is_bld()) then ! Structure here is peculiar, because this function can be called ! either within a parallel region, or outside. - ! Hence the call to set_nzeros done here. - !$omp critical + ! Hence the call to set_nzeros done here. +#if defined(PSB_OPENMP) + !$omp critical(s_coo_csput_a) +#endif nza = a%get_nzeros() nzaold = nza isza = a%get_size() + if (info /= 0) write(0,*) name,' point 0:',info,isza,nza,nz ! Build phase. Must handle reallocations in a sensible way. if (isza < (nza+nz)) then + write(0,*) ' before reallocate in csput ',psb_errstatus_fatal(),info call a%reallocate(max(nza+nz,int(1.5*isza))) + write(0,*) ' after reallocate in csput ',psb_errstatus_fatal(),info endif isza = a%get_size() if (isza < (nza+nz)) then - info = psb_err_alloc_dealloc_; call psb_errpush(info,name) + info = psb_err_alloc_dealloc_; + write(0,*) name,' point 1:',info,isza,nza,nz,nza+nz + call psb_errpush(info,name) else -#if defined(OPENMP) +#if defined(PSB_OPENMP) nza = nza + nz #endif call a%set_nzeros(nza) end if - !$omp end critical - if (info /= 0) goto 9999 +#if defined(PSB_OPENMP) + if (info /= 0) write(0,*) name,' point 1.5:',info + !$omp end critical(s_coo_csput_a) +#endif + if (info /= 0) then + write(0,*) name,' point 2:',info + goto 9999 + end if call psb_inner_ins(nz,ia,ja,val,nzaold,a%ia,a%ja,a%val,isza,& & imin,imax,jmin,jmax,info) -#if !defined(OPENMP) +#if !defined(PSB_OPENMP) nza = nzaold call a%set_nzeros(nza) #endif @@ -2946,7 +2959,7 @@ contains integer(psb_ipk_) :: i,ir,ic info = psb_success_ -#if defined(OPENMP) +#if defined(PSB_OPENMP) ! Disabling OpenMP parallel do for the time being. ! Will need to redesign the entire code stack ! The logic here is different from the one used for @@ -3133,7 +3146,7 @@ subroutine psb_s_cp_coo_to_coo(a,b,info) call b%set_nzeros(nz) call b%reallocate(nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -3186,7 +3199,7 @@ subroutine psb_s_cp_coo_from_coo(a,b,info) call a%set_nzeros(nz) call a%reallocate(nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -3572,7 +3585,7 @@ subroutine psb_s_coo_tril(a,l,info,& nb = jmax_ endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_), allocatable :: lrws(:),urws(:) integer(psb_ipk_) :: lpnt, upnt, lnz, unz @@ -3868,7 +3881,7 @@ subroutine psb_s_coo_triu(a,u,info,& nb = jmax_ endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_), allocatable :: lrws(:),urws(:) integer(psb_ipk_) :: lpnt, upnt, lnz, unz @@ -4158,7 +4171,7 @@ subroutine psb_s_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) use psb_string_mod use psb_ip_reord_mod use psb_sort_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -4176,7 +4189,7 @@ subroutine psb_s_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name = 'psb_fixcoo' logical :: srt_inp, use_buffers -#if defined(OPENMP) +#if defined(PSB_OPENMP) integer(psb_ipk_) :: work,idxstart,idxend,first_elem,last_elem,s,nthreads,ithread integer(psb_ipk_) :: saved_elem,old_val,nxt_val,err,act_row,act_col,maxthreads #endif @@ -4204,7 +4217,7 @@ subroutine psb_s_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) dupl_ = dupl -#if defined(OPENMP) +#if defined(PSB_OPENMP) maxthreads = omp_get_max_threads() ! 'iaux' has to allow the threads to have an exclusive group ! of indices as work space. Since each thread handles one @@ -4260,7 +4273,7 @@ subroutine psb_s_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf use psb_string_mod use psb_ip_reord_mod use psb_sort_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -4278,7 +4291,7 @@ subroutine psb_s_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf character(len=20) :: name = 'psb_fixcoo' logical :: srt_inp, use_buffers real(psb_dpk_) :: t0, t1 -#if defined(OPENMP) +#if defined(PSB_OPENMP) integer(psb_ipk_) :: work,idxstart,idxend,first_elem,last_elem,s,nthreads,ithread integer(psb_ipk_) :: saved_elem,old_val,nxt_val,err,act_row,act_col,maxthreads integer(psb_ipk_), allocatable :: kaux(:),idxaux(:) @@ -4293,7 +4306,7 @@ subroutine psb_s_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf ! Row major order if (nr <= nzin) then ! Avoid strange situations with large indices -#if defined(OPENMP) +#if defined(PSB_OPENMP) ! We are not going to need 'ix2' because of the presence ! of 'idxaux' as auxiliary buffer. allocate(ias(nzin),jas(nzin),vs(nzin), stat=info) @@ -4306,7 +4319,7 @@ subroutine psb_s_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf end if !if (use_buffers) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp workshare iaux(:) = 0 !$omp end workshare @@ -4360,7 +4373,7 @@ subroutine psb_s_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf ! all the indices are valid ! Check again use_buffers. if (use_buffers) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) maxthreads = omp_get_max_threads() allocate(kaux(nr+1),idxaux(MAX(nc+2,nr+2)),stat=info) if (info /= psb_success_) then @@ -4734,7 +4747,7 @@ subroutine psb_s_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf call psi_msort_up(nzin,ia(1:),iaux(1:),iret) if (iret == 0) & & call psb_ip_reord(nzin,val,ia,ja,iaux) -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP PARALLEL & !$OMP shared(nr,nc,nzin,iaux,ia,ja,val,nthreads,maxnzr) & !$OMP private(i,j,idxstart,idxend,nzl,act_row,iret,ithread, & @@ -4924,7 +4937,7 @@ subroutine psb_s_cp_coo_to_lcoo(a,b,info) call b%set_nzeros(nz) call b%reallocate(nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -4976,7 +4989,7 @@ subroutine psb_s_cp_coo_from_lcoo(a,b,info) call a%set_nzeros(nz) call a%reallocate(nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -5189,7 +5202,7 @@ function psb_ls_coo_maxval(a) result(res) nnz = a%get_nzeros() if (allocated(a%val)) then nnz = min(nnz,size(a%val)) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) reduction(max:res) @@ -5256,7 +5269,7 @@ function psb_ls_coo_csnmi(a) result(res) i = a%ia(j) vt(i) = vt(i) + abs(a%val(j)) end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) reduction(max:res) @@ -5306,7 +5319,7 @@ function psb_ls_coo_csnm1(a) result(res) i = a%ja(j) vt(i) = vt(i) + abs(a%val(j)) end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) reduction(max:res) @@ -5589,7 +5602,7 @@ subroutine psb_ls_coo_spaxpby(alpha,a,beta,b,info) ! Allocate (temporary) space for the solution call tcoo%allocate(M,N,(nza+nzb)) ! Compute the sum -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -5700,7 +5713,7 @@ function psb_ls_coo_cmpmat(a,b,tol,info) result(res) ! Allocate (temporary) space for the solution call tcoo%allocate(M,N,(nza+nzb)) ! Compute the sum -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -5961,7 +5974,7 @@ subroutine psb_ls_coo_clean_negidx(a,info) end subroutine psb_ls_coo_clean_negidx -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_ls_coo_clean_negidx_inner(nzin,ia,ja,val,nzout,info) use psb_error_mod use psb_s_base_mat_mod, psb_protect_name => psb_ls_coo_clean_negidx_inner diff --git a/base/serial/impl/psb_s_csc_impl.F90 b/base/serial/impl/psb_s_csc_impl.F90 index 20c9321e..73c11ce6 100644 --- a/base/serial/impl/psb_s_csc_impl.F90 +++ b/base/serial/impl/psb_s_csc_impl.F90 @@ -2189,7 +2189,7 @@ subroutine psb_s_mv_csc_from_coo(a,b,info) use psb_error_mod use psb_s_base_mat_mod use psb_s_csc_mat_mod, psb_protect_name => psb_s_mv_csc_from_coo -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -2226,7 +2226,7 @@ subroutine psb_s_mv_csc_from_coo(a,b,info) call psb_realloc(nc+1,a%icp,info) call b%free() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP PARALLEL default(shared) diff --git a/base/serial/impl/psb_s_csr_impl.F90 b/base/serial/impl/psb_s_csr_impl.F90 index 72c85fd2..01657071 100644 --- a/base/serial/impl/psb_s_csr_impl.F90 +++ b/base/serial/impl/psb_s_csr_impl.F90 @@ -2289,7 +2289,7 @@ subroutine psb_s_csr_tril(a,l,info,& nb = jmax_ endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_), allocatable :: lrws(:),urws(:) integer(psb_ipk_) :: lpnt, upnt, lnz, unz @@ -2591,7 +2591,7 @@ subroutine psb_s_csr_triu(a,u,info,& endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_), allocatable :: lrws(:),urws(:) integer(psb_ipk_) :: lpnt, upnt, lnz, unz @@ -3156,7 +3156,7 @@ subroutine psb_s_cp_csr_from_coo(a,b,info) use psb_realloc_mod use psb_s_base_mat_mod use psb_s_csr_mat_mod, psb_protect_name => psb_s_cp_csr_from_coo -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -3217,7 +3217,7 @@ subroutine psb_s_cp_csr_from_coo(a,b,info) endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP PARALLEL default(shared) reduction(max:info) @@ -3346,7 +3346,7 @@ subroutine psb_s_mv_csr_from_coo(a,b,info) use psb_error_mod use psb_s_base_mat_mod use psb_s_csr_mat_mod, psb_protect_name => psb_s_mv_csr_from_coo -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -3385,7 +3385,7 @@ subroutine psb_s_mv_csr_from_coo(a,b,info) call psb_realloc(max(nr+1,nc+1),a%irp,info) call b%free() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP PARALLEL default(shared) reduction(max:info) @@ -3655,7 +3655,7 @@ end subroutine psb_s_cp_csr_from_fmt !!$ call a%set_host() !!$end subroutine psb_s_csr_clean_zeros -#if defined(OPENMP) +#if defined(PSB_OPENMP) subroutine psb_scsrspspmm(a,b,c,info) use psb_s_mat_mod use psb_serial_mod, psb_protect_name => psb_scsrspspmm diff --git a/base/serial/impl/psb_s_mat_impl.F90 b/base/serial/impl/psb_s_mat_impl.F90 index 77ac81e6..a27a24a5 100644 --- a/base/serial/impl/psb_s_mat_impl.F90 +++ b/base/serial/impl/psb_s_mat_impl.F90 @@ -3111,7 +3111,7 @@ subroutine psb_ls_set_lnrows(m,a) end subroutine psb_ls_set_lnrows -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_ls_set_inrows(m,a) use psb_s_mat_mod, psb_protect_name => psb_ls_set_inrows use psb_error_mod @@ -3168,7 +3168,7 @@ subroutine psb_ls_set_lncols(n,a) end subroutine psb_ls_set_lncols -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_ls_set_incols(n,a) use psb_s_mat_mod, psb_protect_name => psb_ls_set_incols use psb_error_mod diff --git a/base/serial/impl/psb_s_rb_idx_tree_impl.F90 b/base/serial/impl/psb_s_rb_idx_tree_impl.F90 index ae624f72..5241225e 100644 --- a/base/serial/impl/psb_s_rb_idx_tree_impl.F90 +++ b/base/serial/impl/psb_s_rb_idx_tree_impl.F90 @@ -267,7 +267,7 @@ subroutine psb_s_rb_idx_tree_scalar_sparse_row_mul(tree, scalar, mat, row_num) end subroutine psb_s_rb_idx_tree_scalar_sparse_row_mul subroutine psb_s_rb_idx_tree_merge(trees, mat) -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif use psb_realloc_mod @@ -294,7 +294,7 @@ subroutine psb_s_rb_idx_tree_merge(trees, mat) call psb_realloc(nnz, mat%val, info) call psb_realloc(nnz, mat%ja, info) -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do schedule(static), private(current, previous, j) #endif do i = 1, size(trees) @@ -323,7 +323,7 @@ subroutine psb_s_rb_idx_tree_merge(trees, mat) deallocate(previous) end do end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp end parallel do #endif end subroutine psb_s_rb_idx_tree_merge diff --git a/base/serial/impl/psb_z_coo_impl.F90 b/base/serial/impl/psb_z_coo_impl.F90 index 2a3c01e2..f88dc92b 100644 --- a/base/serial/impl/psb_z_coo_impl.F90 +++ b/base/serial/impl/psb_z_coo_impl.F90 @@ -257,7 +257,7 @@ subroutine psb_z_coo_spaxpby(alpha,a,beta,b,info) ! Allocate (temporary) space for the solution call tcoo%allocate(M,N,(nza+nzb)) ! Compute the sum -#if defined (OPENMP) +#if defined (PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -368,7 +368,7 @@ function psb_z_coo_cmpmat(a,b,tol,info) result(res) ! Allocate (temporary) space for the solution call tcoo%allocate(M,N,(nza+nzb)) ! Compute the sum -#if defined (OPENMP) +#if defined (PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -1930,7 +1930,7 @@ function psb_z_coo_maxval(a) result(res) nnz = a%get_nzeros() if (allocated(a%val)) then nnz = min(nnz,size(a%val)) -#if defined(OPENMP) +#if defined(PSB_OPENMP) res = dzero !$omp parallel do private(i) reduction(max: res) do i=1, nnz @@ -2820,7 +2820,7 @@ subroutine psb_z_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) use psb_realloc_mod use psb_sort_mod use psb_z_base_mat_mod, psb_protect_name => psb_z_coo_csput_a -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -2869,29 +2869,42 @@ subroutine psb_z_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) if (a%is_bld()) then ! Structure here is peculiar, because this function can be called ! either within a parallel region, or outside. - ! Hence the call to set_nzeros done here. - !$omp critical + ! Hence the call to set_nzeros done here. +#if defined(PSB_OPENMP) + !$omp critical(z_coo_csput_a) +#endif nza = a%get_nzeros() nzaold = nza isza = a%get_size() + if (info /= 0) write(0,*) name,' point 0:',info,isza,nza,nz ! Build phase. Must handle reallocations in a sensible way. if (isza < (nza+nz)) then + write(0,*) ' before reallocate in csput ',psb_errstatus_fatal(),info call a%reallocate(max(nza+nz,int(1.5*isza))) + write(0,*) ' after reallocate in csput ',psb_errstatus_fatal(),info endif isza = a%get_size() if (isza < (nza+nz)) then - info = psb_err_alloc_dealloc_; call psb_errpush(info,name) + info = psb_err_alloc_dealloc_; + write(0,*) name,' point 1:',info,isza,nza,nz,nza+nz + call psb_errpush(info,name) else -#if defined(OPENMP) +#if defined(PSB_OPENMP) nza = nza + nz #endif call a%set_nzeros(nza) end if - !$omp end critical - if (info /= 0) goto 9999 +#if defined(PSB_OPENMP) + if (info /= 0) write(0,*) name,' point 1.5:',info + !$omp end critical(z_coo_csput_a) +#endif + if (info /= 0) then + write(0,*) name,' point 2:',info + goto 9999 + end if call psb_inner_ins(nz,ia,ja,val,nzaold,a%ia,a%ja,a%val,isza,& & imin,imax,jmin,jmax,info) -#if !defined(OPENMP) +#if !defined(PSB_OPENMP) nza = nzaold call a%set_nzeros(nza) #endif @@ -2946,7 +2959,7 @@ contains integer(psb_ipk_) :: i,ir,ic info = psb_success_ -#if defined(OPENMP) +#if defined(PSB_OPENMP) ! Disabling OpenMP parallel do for the time being. ! Will need to redesign the entire code stack ! The logic here is different from the one used for @@ -3133,7 +3146,7 @@ subroutine psb_z_cp_coo_to_coo(a,b,info) call b%set_nzeros(nz) call b%reallocate(nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -3186,7 +3199,7 @@ subroutine psb_z_cp_coo_from_coo(a,b,info) call a%set_nzeros(nz) call a%reallocate(nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -3572,7 +3585,7 @@ subroutine psb_z_coo_tril(a,l,info,& nb = jmax_ endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_), allocatable :: lrws(:),urws(:) integer(psb_ipk_) :: lpnt, upnt, lnz, unz @@ -3868,7 +3881,7 @@ subroutine psb_z_coo_triu(a,u,info,& nb = jmax_ endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_), allocatable :: lrws(:),urws(:) integer(psb_ipk_) :: lpnt, upnt, lnz, unz @@ -4158,7 +4171,7 @@ subroutine psb_z_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) use psb_string_mod use psb_ip_reord_mod use psb_sort_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -4176,7 +4189,7 @@ subroutine psb_z_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name = 'psb_fixcoo' logical :: srt_inp, use_buffers -#if defined(OPENMP) +#if defined(PSB_OPENMP) integer(psb_ipk_) :: work,idxstart,idxend,first_elem,last_elem,s,nthreads,ithread integer(psb_ipk_) :: saved_elem,old_val,nxt_val,err,act_row,act_col,maxthreads #endif @@ -4204,7 +4217,7 @@ subroutine psb_z_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) dupl_ = dupl -#if defined(OPENMP) +#if defined(PSB_OPENMP) maxthreads = omp_get_max_threads() ! 'iaux' has to allow the threads to have an exclusive group ! of indices as work space. Since each thread handles one @@ -4260,7 +4273,7 @@ subroutine psb_z_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf use psb_string_mod use psb_ip_reord_mod use psb_sort_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -4278,7 +4291,7 @@ subroutine psb_z_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf character(len=20) :: name = 'psb_fixcoo' logical :: srt_inp, use_buffers real(psb_dpk_) :: t0, t1 -#if defined(OPENMP) +#if defined(PSB_OPENMP) integer(psb_ipk_) :: work,idxstart,idxend,first_elem,last_elem,s,nthreads,ithread integer(psb_ipk_) :: saved_elem,old_val,nxt_val,err,act_row,act_col,maxthreads integer(psb_ipk_), allocatable :: kaux(:),idxaux(:) @@ -4293,7 +4306,7 @@ subroutine psb_z_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf ! Row major order if (nr <= nzin) then ! Avoid strange situations with large indices -#if defined(OPENMP) +#if defined(PSB_OPENMP) ! We are not going to need 'ix2' because of the presence ! of 'idxaux' as auxiliary buffer. allocate(ias(nzin),jas(nzin),vs(nzin), stat=info) @@ -4306,7 +4319,7 @@ subroutine psb_z_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf end if !if (use_buffers) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp workshare iaux(:) = 0 !$omp end workshare @@ -4360,7 +4373,7 @@ subroutine psb_z_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf ! all the indices are valid ! Check again use_buffers. if (use_buffers) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) maxthreads = omp_get_max_threads() allocate(kaux(nr+1),idxaux(MAX(nc+2,nr+2)),stat=info) if (info /= psb_success_) then @@ -4734,7 +4747,7 @@ subroutine psb_z_fix_coo_inner_rowmajor(nr,nc,nzin,dupl,ia,ja,val,iaux,nzout,inf call psi_msort_up(nzin,ia(1:),iaux(1:),iret) if (iret == 0) & & call psb_ip_reord(nzin,val,ia,ja,iaux) -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP PARALLEL & !$OMP shared(nr,nc,nzin,iaux,ia,ja,val,nthreads,maxnzr) & !$OMP private(i,j,idxstart,idxend,nzl,act_row,iret,ithread, & @@ -4924,7 +4937,7 @@ subroutine psb_z_cp_coo_to_lcoo(a,b,info) call b%set_nzeros(nz) call b%reallocate(nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -4976,7 +4989,7 @@ subroutine psb_z_cp_coo_from_lcoo(a,b,info) call a%set_nzeros(nz) call a%reallocate(nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -5189,7 +5202,7 @@ function psb_lz_coo_maxval(a) result(res) nnz = a%get_nzeros() if (allocated(a%val)) then nnz = min(nnz,size(a%val)) -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) reduction(max:res) @@ -5256,7 +5269,7 @@ function psb_lz_coo_csnmi(a) result(res) i = a%ia(j) vt(i) = vt(i) + abs(a%val(j)) end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) reduction(max:res) @@ -5306,7 +5319,7 @@ function psb_lz_coo_csnm1(a) result(res) i = a%ja(j) vt(i) = vt(i) + abs(a%val(j)) end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) reduction(max:res) @@ -5589,7 +5602,7 @@ subroutine psb_lz_coo_spaxpby(alpha,a,beta,b,info) ! Allocate (temporary) space for the solution call tcoo%allocate(M,N,(nza+nzb)) ! Compute the sum -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -5700,7 +5713,7 @@ function psb_lz_coo_cmpmat(a,b,tol,info) result(res) ! Allocate (temporary) space for the solution call tcoo%allocate(M,N,(nza+nzb)) ! Compute the sum -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_) :: i !$omp parallel do private(i) @@ -5961,7 +5974,7 @@ subroutine psb_lz_coo_clean_negidx(a,info) end subroutine psb_lz_coo_clean_negidx -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_lz_coo_clean_negidx_inner(nzin,ia,ja,val,nzout,info) use psb_error_mod use psb_z_base_mat_mod, psb_protect_name => psb_lz_coo_clean_negidx_inner diff --git a/base/serial/impl/psb_z_csc_impl.F90 b/base/serial/impl/psb_z_csc_impl.F90 index b47a3727..95de776d 100644 --- a/base/serial/impl/psb_z_csc_impl.F90 +++ b/base/serial/impl/psb_z_csc_impl.F90 @@ -2189,7 +2189,7 @@ subroutine psb_z_mv_csc_from_coo(a,b,info) use psb_error_mod use psb_z_base_mat_mod use psb_z_csc_mat_mod, psb_protect_name => psb_z_mv_csc_from_coo -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -2226,7 +2226,7 @@ subroutine psb_z_mv_csc_from_coo(a,b,info) call psb_realloc(nc+1,a%icp,info) call b%free() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP PARALLEL default(shared) diff --git a/base/serial/impl/psb_z_csr_impl.F90 b/base/serial/impl/psb_z_csr_impl.F90 index 6088d534..947c8329 100644 --- a/base/serial/impl/psb_z_csr_impl.F90 +++ b/base/serial/impl/psb_z_csr_impl.F90 @@ -2289,7 +2289,7 @@ subroutine psb_z_csr_tril(a,l,info,& nb = jmax_ endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_), allocatable :: lrws(:),urws(:) integer(psb_ipk_) :: lpnt, upnt, lnz, unz @@ -2591,7 +2591,7 @@ subroutine psb_z_csr_triu(a,u,info,& endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) block integer(psb_ipk_), allocatable :: lrws(:),urws(:) integer(psb_ipk_) :: lpnt, upnt, lnz, unz @@ -3156,7 +3156,7 @@ subroutine psb_z_cp_csr_from_coo(a,b,info) use psb_realloc_mod use psb_z_base_mat_mod use psb_z_csr_mat_mod, psb_protect_name => psb_z_cp_csr_from_coo -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -3217,7 +3217,7 @@ subroutine psb_z_cp_csr_from_coo(a,b,info) endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP PARALLEL default(shared) reduction(max:info) @@ -3346,7 +3346,7 @@ subroutine psb_z_mv_csr_from_coo(a,b,info) use psb_error_mod use psb_z_base_mat_mod use psb_z_csr_mat_mod, psb_protect_name => psb_z_mv_csr_from_coo -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -3385,7 +3385,7 @@ subroutine psb_z_mv_csr_from_coo(a,b,info) call psb_realloc(max(nr+1,nc+1),a%irp,info) call b%free() -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP PARALLEL default(shared) reduction(max:info) @@ -3655,7 +3655,7 @@ end subroutine psb_z_cp_csr_from_fmt !!$ call a%set_host() !!$end subroutine psb_z_csr_clean_zeros -#if defined(OPENMP) +#if defined(PSB_OPENMP) subroutine psb_zcsrspspmm(a,b,c,info) use psb_z_mat_mod use psb_serial_mod, psb_protect_name => psb_zcsrspspmm diff --git a/base/serial/impl/psb_z_mat_impl.F90 b/base/serial/impl/psb_z_mat_impl.F90 index 18d6c03d..e1f9310b 100644 --- a/base/serial/impl/psb_z_mat_impl.F90 +++ b/base/serial/impl/psb_z_mat_impl.F90 @@ -3111,7 +3111,7 @@ subroutine psb_lz_set_lnrows(m,a) end subroutine psb_lz_set_lnrows -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_lz_set_inrows(m,a) use psb_z_mat_mod, psb_protect_name => psb_lz_set_inrows use psb_error_mod @@ -3168,7 +3168,7 @@ subroutine psb_lz_set_lncols(n,a) end subroutine psb_lz_set_lncols -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_lz_set_incols(n,a) use psb_z_mat_mod, psb_protect_name => psb_lz_set_incols use psb_error_mod diff --git a/base/serial/impl/psb_z_rb_idx_tree_impl.F90 b/base/serial/impl/psb_z_rb_idx_tree_impl.F90 index 88ab214b..42695158 100644 --- a/base/serial/impl/psb_z_rb_idx_tree_impl.F90 +++ b/base/serial/impl/psb_z_rb_idx_tree_impl.F90 @@ -267,7 +267,7 @@ subroutine psb_z_rb_idx_tree_scalar_sparse_row_mul(tree, scalar, mat, row_num) end subroutine psb_z_rb_idx_tree_scalar_sparse_row_mul subroutine psb_z_rb_idx_tree_merge(trees, mat) -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif use psb_realloc_mod @@ -294,7 +294,7 @@ subroutine psb_z_rb_idx_tree_merge(trees, mat) call psb_realloc(nnz, mat%val, info) call psb_realloc(nnz, mat%ja, info) -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel do schedule(static), private(current, previous, j) #endif do i = 1, size(trees) @@ -323,7 +323,7 @@ subroutine psb_z_rb_idx_tree_merge(trees, mat) deallocate(previous) end do end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp end parallel do #endif end subroutine psb_z_rb_idx_tree_merge diff --git a/base/serial/psi_c_serial_impl.F90 b/base/serial/psi_c_serial_impl.F90 index 34239776..a5290da4 100644 --- a/base/serial/psi_c_serial_impl.F90 +++ b/base/serial/psi_c_serial_impl.F90 @@ -33,7 +33,7 @@ subroutine psi_c_exscanv(n,x,info,shift) use psi_c_serial_mod, psb_protect_name => psi_c_exscanv use psb_const_mod use psb_error_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -53,7 +53,7 @@ subroutine psi_c_exscanv(n,x,info,shift) shift_ = czero end if -#if defined(OPENMP) +#if defined(PSB_OPENMP) is_parallel = omp_in_parallel() if (is_parallel) then call inner_c_exscan() @@ -71,7 +71,7 @@ subroutine psi_c_exscanv(n,x,info,shift) end do #endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) contains subroutine inner_c_exscan() ! Note: all these variables are private, but SUMB should *really* be diff --git a/base/serial/psi_d_serial_impl.F90 b/base/serial/psi_d_serial_impl.F90 index 7bfbf300..bbc7acec 100644 --- a/base/serial/psi_d_serial_impl.F90 +++ b/base/serial/psi_d_serial_impl.F90 @@ -33,7 +33,7 @@ subroutine psi_d_exscanv(n,x,info,shift) use psi_d_serial_mod, psb_protect_name => psi_d_exscanv use psb_const_mod use psb_error_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -53,7 +53,7 @@ subroutine psi_d_exscanv(n,x,info,shift) shift_ = dzero end if -#if defined(OPENMP) +#if defined(PSB_OPENMP) is_parallel = omp_in_parallel() if (is_parallel) then call inner_d_exscan() @@ -71,7 +71,7 @@ subroutine psi_d_exscanv(n,x,info,shift) end do #endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) contains subroutine inner_d_exscan() ! Note: all these variables are private, but SUMB should *really* be diff --git a/base/serial/psi_e_serial_impl.F90 b/base/serial/psi_e_serial_impl.F90 index 12734b33..882372c0 100644 --- a/base/serial/psi_e_serial_impl.F90 +++ b/base/serial/psi_e_serial_impl.F90 @@ -33,7 +33,7 @@ subroutine psi_e_exscanv(n,x,info,shift) use psi_e_serial_mod, psb_protect_name => psi_e_exscanv use psb_const_mod use psb_error_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -53,7 +53,7 @@ subroutine psi_e_exscanv(n,x,info,shift) shift_ = ezero end if -#if defined(OPENMP) +#if defined(PSB_OPENMP) is_parallel = omp_in_parallel() if (is_parallel) then call inner_e_exscan() @@ -71,7 +71,7 @@ subroutine psi_e_exscanv(n,x,info,shift) end do #endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) contains subroutine inner_e_exscan() ! Note: all these variables are private, but SUMB should *really* be diff --git a/base/serial/psi_i2_serial_impl.F90 b/base/serial/psi_i2_serial_impl.F90 index 5462c7c3..8f1d0332 100644 --- a/base/serial/psi_i2_serial_impl.F90 +++ b/base/serial/psi_i2_serial_impl.F90 @@ -33,7 +33,7 @@ subroutine psi_i2_exscanv(n,x,info,shift) use psi_i2_serial_mod, psb_protect_name => psi_i2_exscanv use psb_const_mod use psb_error_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -53,7 +53,7 @@ subroutine psi_i2_exscanv(n,x,info,shift) shift_ = i2zero end if -#if defined(OPENMP) +#if defined(PSB_OPENMP) is_parallel = omp_in_parallel() if (is_parallel) then call inner_i2_exscan() @@ -71,7 +71,7 @@ subroutine psi_i2_exscanv(n,x,info,shift) end do #endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) contains subroutine inner_i2_exscan() ! Note: all these variables are private, but SUMB should *really* be diff --git a/base/serial/psi_m_serial_impl.F90 b/base/serial/psi_m_serial_impl.F90 index 8f809e23..aff8745c 100644 --- a/base/serial/psi_m_serial_impl.F90 +++ b/base/serial/psi_m_serial_impl.F90 @@ -33,7 +33,7 @@ subroutine psi_m_exscanv(n,x,info,shift) use psi_m_serial_mod, psb_protect_name => psi_m_exscanv use psb_const_mod use psb_error_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -53,7 +53,7 @@ subroutine psi_m_exscanv(n,x,info,shift) shift_ = mzero end if -#if defined(OPENMP) +#if defined(PSB_OPENMP) is_parallel = omp_in_parallel() if (is_parallel) then call inner_m_exscan() @@ -71,7 +71,7 @@ subroutine psi_m_exscanv(n,x,info,shift) end do #endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) contains subroutine inner_m_exscan() ! Note: all these variables are private, but SUMB should *really* be diff --git a/base/serial/psi_s_serial_impl.F90 b/base/serial/psi_s_serial_impl.F90 index 15f94202..7bfb796c 100644 --- a/base/serial/psi_s_serial_impl.F90 +++ b/base/serial/psi_s_serial_impl.F90 @@ -33,7 +33,7 @@ subroutine psi_s_exscanv(n,x,info,shift) use psi_s_serial_mod, psb_protect_name => psi_s_exscanv use psb_const_mod use psb_error_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -53,7 +53,7 @@ subroutine psi_s_exscanv(n,x,info,shift) shift_ = szero end if -#if defined(OPENMP) +#if defined(PSB_OPENMP) is_parallel = omp_in_parallel() if (is_parallel) then call inner_s_exscan() @@ -71,7 +71,7 @@ subroutine psi_s_exscanv(n,x,info,shift) end do #endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) contains subroutine inner_s_exscan() ! Note: all these variables are private, but SUMB should *really* be diff --git a/base/serial/psi_z_serial_impl.F90 b/base/serial/psi_z_serial_impl.F90 index 7ea77a62..e5ab9334 100644 --- a/base/serial/psi_z_serial_impl.F90 +++ b/base/serial/psi_z_serial_impl.F90 @@ -33,7 +33,7 @@ subroutine psi_z_exscanv(n,x,info,shift) use psi_z_serial_mod, psb_protect_name => psi_z_exscanv use psb_const_mod use psb_error_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -53,7 +53,7 @@ subroutine psi_z_exscanv(n,x,info,shift) shift_ = zzero end if -#if defined(OPENMP) +#if defined(PSB_OPENMP) is_parallel = omp_in_parallel() if (is_parallel) then call inner_z_exscan() @@ -71,7 +71,7 @@ subroutine psi_z_exscanv(n,x,info,shift) end do #endif -#if defined(OPENMP) +#if defined(PSB_OPENMP) contains subroutine inner_z_exscan() ! Note: all these variables are private, but SUMB should *really* be diff --git a/base/tools/psb_c_glob_transpose.F90 b/base/tools/psb_c_glob_transpose.F90 index 4f6804fc..37a4e100 100644 --- a/base/tools/psb_c_glob_transpose.F90 +++ b/base/tools/psb_c_glob_transpose.F90 @@ -94,12 +94,12 @@ ! ! subroutine psb_lc_coo_glob_transpose(ain,desc_r,info,atrans,desc_c,desc_rx) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif use psb_base_mod, psb_protect_name => psb_lc_coo_glob_transpose Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_lc_coo_sparse_mat), intent(inout) :: ain @@ -392,12 +392,12 @@ subroutine psb_lc_coo_glob_transpose(ain,desc_r,info,atrans,desc_c,desc_rx) end subroutine psb_lc_coo_glob_transpose subroutine psb_c_coo_glob_transpose(ain,desc_r,info,atrans,desc_c,desc_rx) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif use psb_base_mod, psb_protect_name => psb_c_coo_glob_transpose Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_c_coo_sparse_mat), intent(inout) :: ain diff --git a/base/tools/psb_c_remote_mat.F90 b/base/tools/psb_c_remote_mat.F90 index ae2eaaf2..bb40edf3 100644 --- a/base/tools/psb_c_remote_mat.F90 +++ b/base/tools/psb_c_remote_mat.F90 @@ -73,11 +73,11 @@ Subroutine psb_lc_remote_mat(a,desc_a,b,info) use psb_base_mod, psb_protect_name => psb_lc_remote_mat -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/tools/psb_c_remote_vect.F90 b/base/tools/psb_c_remote_vect.F90 index bd5286fa..5cacd9a3 100644 --- a/base/tools/psb_c_remote_vect.F90 +++ b/base/tools/psb_c_remote_vect.F90 @@ -66,11 +66,11 @@ subroutine psb_c_remote_vect(n,v,iv,desc_a,x,ix, info) use psb_base_mod, psb_protect_name => psb_c_remote_vect -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_ipk_), intent(in) :: n diff --git a/base/tools/psb_ccdbldext.F90 b/base/tools/psb_ccdbldext.F90 index a9ead509..1e7d630e 100644 --- a/base/tools/psb_ccdbldext.F90 +++ b/base/tools/psb_ccdbldext.F90 @@ -64,11 +64,11 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype) use psb_base_mod, psb_protect_name => psb_ccdbldext use psi_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/tools/psb_cdins.F90 b/base/tools/psb_cdins.F90 index 4de000db..d29aeef8 100644 --- a/base/tools/psb_cdins.F90 +++ b/base/tools/psb_cdins.F90 @@ -45,7 +45,7 @@ ! ila(:) - integer(psb_ipk_), optional The row indices in local numbering ! jla(:) - integer(psb_ipk_), optional The col indices in local numbering ! -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_cdinsrc(nz,ia,ja,desc_a,info,ila,jla) use psb_base_mod, psb_protect_name => psb_cdinsrc use psi_mod @@ -182,7 +182,7 @@ end subroutine psb_lcdinsrc ! mask(:) - logical, optional, target ! lidx(:) - integer(psb_ipk_), optional User-defined local col indices ! -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_cdinsc(nz,ja,desc,info,jla,mask,lidx) use psb_base_mod, psb_protect_name => psb_cdinsc use psi_mod diff --git a/base/tools/psb_csphalo.F90 b/base/tools/psb_csphalo.F90 index 19d7e1dc..4c56cc5e 100644 --- a/base/tools/psb_csphalo.F90 +++ b/base/tools/psb_csphalo.F90 @@ -74,11 +74,11 @@ Subroutine psb_csphalo(a,desc_a,blk,info,rowcnv,colcnv,& & rowscale,colscale,outfmt,data) use psb_base_mod, psb_protect_name => psb_csphalo -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -100,7 +100,7 @@ Subroutine psb_csphalo(a,desc_a,blk,info,rowcnv,colcnv,& integer(psb_mpk_) :: icomm, minfo integer(psb_mpk_), allocatable :: brvindx(:), & & rvsz(:), bsdindx(:),sdsz(:) -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) ! If globals are 8 bytes but locals are 4, things get tricky integer(psb_ipk_), allocatable :: liasnd(:), ljasnd(:) integer(psb_lpk_), allocatable :: iasnd(:), jasnd(:), iarcv(:), jarcv(:) @@ -268,7 +268,7 @@ Subroutine psb_csphalo(a,desc_a,blk,info,rowcnv,colcnv,& call psb_ensure_size(max(iszs,1),iasnd,info) if (info == psb_success_) call psb_ensure_size(max(iszs,1),jasnd,info) if (info == psb_success_) call psb_ensure_size(max(iszs,1),valsnd,info) -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) ! If globals are 8 bytes but locals are not, things get tricky if (info == psb_success_) call psb_ensure_size(max(iszs,1),liasnd,info) if (info == psb_success_) call psb_ensure_size(max(iszs,1),ljasnd,info) @@ -540,11 +540,11 @@ Subroutine psb_lcsphalo(a,desc_a,blk,info,rowcnv,colcnv,& & rowscale,colscale,outfmt,data) use psb_base_mod, psb_protect_name => psb_lcsphalo -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -883,11 +883,11 @@ Subroutine psb_lc_csr_halo(a,desc_a,blk,info,rowcnv,colcnv,& & rowscale,colscale,data,outcol_glob,col_desc) use psb_base_mod, psb_protect_name => psb_lc_csr_halo -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -1243,11 +1243,11 @@ Subroutine psb_c_lc_csr_halo(a,desc_a,blk,info,rowcnv,colcnv,& & rowscale,colscale,data,outcol_glob,col_desc) use psb_base_mod, psb_protect_name => psb_c_lc_csr_halo -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/tools/psb_cspins.F90 b/base/tools/psb_cspins.F90 index c6442b6f..e57a98d4 100644 --- a/base/tools/psb_cspins.F90 +++ b/base/tools/psb_cspins.F90 @@ -51,7 +51,7 @@ subroutine psb_cspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) use psb_base_mod, psb_protect_name => psb_cspins use psi_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -134,11 +134,11 @@ subroutine psb_cspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) & a_err='allocate',i_err=(/info/)) goto 9999 end if -#if 0 && defined(OPENMP) +#if defined(PSB_OPENMP) block - logical :: is_in_parallel + logical :: is_in_parallel is_in_parallel = omp_in_parallel() - if (is_in_parallel) then + if (.false..and.is_in_parallel) then !$omp parallel private(ila,jla,nrow,ncol,nnl,k) call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.) !$omp critical(spins) @@ -148,7 +148,7 @@ subroutine psb_cspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !write(0,*) me,' after g2l_ins ',psb_errstatus_fatal(),info if (info /= psb_success_) then call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='psb_cdins',i_err=(/info/)) + & a_err='g2l_ins 1',i_err=(/info/)) goto 9998 end if nrow = desc_a%get_local_rows() @@ -189,22 +189,25 @@ subroutine psb_cspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !write(0,*) me,' after csput',psb_errstatus_fatal() !$omp end parallel else + !write(0,*) me,' Before g2l ',psb_errstatus_fatal() call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.) !write(0,*) me,' Before g2l_ins ',psb_errstatus_fatal() if (info == 0) call desc_a%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info,& & mask=(ila(1:nz)>0)) !write(0,*) me,' after g2l_ins ',psb_errstatus_fatal(),info - if (info /= psb_success_) then + if ((info /= psb_success_).or.psb_errstatus_fatal()) then call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='psb_cdins',i_err=(/info/)) + & a_err='g2l_ins 2 ',i_err=(/info/)) goto 9999 end if nrow = desc_a%get_local_rows() ncol = desc_a%get_local_cols() !write(0,*) me,' Before csput',psb_errstatus_fatal() - if (a%is_bld()) then + if (a%is_bld()) then + !write(0,*) me,' before csput ',psb_errstatus_fatal(),info,nz call a%csput(nz,ila,jla,val,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then + !write(0,*) me,' after csput ',psb_errstatus_fatal(),info,nz + if ((info /= psb_success_).or.psb_errstatus_fatal()) then info=psb_err_from_subroutine_ call psb_errpush(info,name,a_err='a%csput') goto 9999 @@ -240,6 +243,11 @@ subroutine psb_cspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !write(0,*) me,' Before g2l ',psb_errstatus_fatal() call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.) + if (info /= psb_success_) then + call psb_errpush(psb_err_from_subroutine_ai_,name,& + & a_err='g2l',i_err=(/info/)) + goto 9999 + end if if (info == 0) call desc_a%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info,& & mask=(ila(1:nz)>0)) @@ -247,7 +255,7 @@ subroutine psb_cspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !write(0,*) me,' after g2l_ins ',psb_errstatus_fatal(),info if (info /= psb_success_) then call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='psb_cdins',i_err=(/info/)) + & a_err='g2l_ins',i_err=(/info/)) goto 9999 end if nrow = desc_a%get_local_rows() @@ -287,6 +295,12 @@ subroutine psb_cspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) end if #endif if (info /= 0) goto 9999 + if (psb_errstatus_fatal()) then + info = psb_err_internal_error_ + call psb_errpush(psb_err_from_subroutine_ai_,name,& + & a_err='unknown',i_err=(/info/)) + goto 9999 + end if endif else if (desc_a%is_asb()) then @@ -299,16 +313,16 @@ subroutine psb_cspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) & a_err='allocate',i_err=(/info/)) goto 9999 end if -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel private(ila,jla,nrow,ncol,nnl,k) #endif if (local_) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp workshare #endif ila(1:nz) = ia(1:nz) jla(1:nz) = ja(1:nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp end workshare #endif else @@ -341,7 +355,7 @@ subroutine psb_cspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) & 1_psb_lpk_,desc_a%get_global_rows(),info) end if end if -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp end parallel #endif @@ -458,7 +472,7 @@ subroutine psb_cspins_csr_lirp(nr,irp,ja,val,irw,a,desc_a,info,rebuild,local) end subroutine psb_cspins_csr_lirp -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_cspins_csr_iirp(nr,irw,irp,ja,val,a,desc_a,info,rebuild,local) use psb_base_mod, psb_protect_name => psb_cspins_csr_iirp use psi_mod diff --git a/base/tools/psb_d_glob_transpose.F90 b/base/tools/psb_d_glob_transpose.F90 index caf99400..3c323dbd 100644 --- a/base/tools/psb_d_glob_transpose.F90 +++ b/base/tools/psb_d_glob_transpose.F90 @@ -94,12 +94,12 @@ ! ! subroutine psb_ld_coo_glob_transpose(ain,desc_r,info,atrans,desc_c,desc_rx) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif use psb_base_mod, psb_protect_name => psb_ld_coo_glob_transpose Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ld_coo_sparse_mat), intent(inout) :: ain @@ -392,12 +392,12 @@ subroutine psb_ld_coo_glob_transpose(ain,desc_r,info,atrans,desc_c,desc_rx) end subroutine psb_ld_coo_glob_transpose subroutine psb_d_coo_glob_transpose(ain,desc_r,info,atrans,desc_c,desc_rx) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif use psb_base_mod, psb_protect_name => psb_d_coo_glob_transpose Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_d_coo_sparse_mat), intent(inout) :: ain diff --git a/base/tools/psb_d_remote_mat.F90 b/base/tools/psb_d_remote_mat.F90 index 35116dc5..bab23d59 100644 --- a/base/tools/psb_d_remote_mat.F90 +++ b/base/tools/psb_d_remote_mat.F90 @@ -73,11 +73,11 @@ Subroutine psb_ld_remote_mat(a,desc_a,b,info) use psb_base_mod, psb_protect_name => psb_ld_remote_mat -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/tools/psb_d_remote_vect.F90 b/base/tools/psb_d_remote_vect.F90 index 4a409fa5..440c8cc5 100644 --- a/base/tools/psb_d_remote_vect.F90 +++ b/base/tools/psb_d_remote_vect.F90 @@ -66,11 +66,11 @@ subroutine psb_d_remote_vect(n,v,iv,desc_a,x,ix, info) use psb_base_mod, psb_protect_name => psb_d_remote_vect -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_ipk_), intent(in) :: n diff --git a/base/tools/psb_dcdbldext.F90 b/base/tools/psb_dcdbldext.F90 index fdafb500..a5d059a3 100644 --- a/base/tools/psb_dcdbldext.F90 +++ b/base/tools/psb_dcdbldext.F90 @@ -64,11 +64,11 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype) use psb_base_mod, psb_protect_name => psb_dcdbldext use psi_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/tools/psb_dsphalo.F90 b/base/tools/psb_dsphalo.F90 index d5e383ef..c793eb2a 100644 --- a/base/tools/psb_dsphalo.F90 +++ b/base/tools/psb_dsphalo.F90 @@ -74,11 +74,11 @@ Subroutine psb_dsphalo(a,desc_a,blk,info,rowcnv,colcnv,& & rowscale,colscale,outfmt,data) use psb_base_mod, psb_protect_name => psb_dsphalo -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -100,7 +100,7 @@ Subroutine psb_dsphalo(a,desc_a,blk,info,rowcnv,colcnv,& integer(psb_mpk_) :: icomm, minfo integer(psb_mpk_), allocatable :: brvindx(:), & & rvsz(:), bsdindx(:),sdsz(:) -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) ! If globals are 8 bytes but locals are 4, things get tricky integer(psb_ipk_), allocatable :: liasnd(:), ljasnd(:) integer(psb_lpk_), allocatable :: iasnd(:), jasnd(:), iarcv(:), jarcv(:) @@ -268,7 +268,7 @@ Subroutine psb_dsphalo(a,desc_a,blk,info,rowcnv,colcnv,& call psb_ensure_size(max(iszs,1),iasnd,info) if (info == psb_success_) call psb_ensure_size(max(iszs,1),jasnd,info) if (info == psb_success_) call psb_ensure_size(max(iszs,1),valsnd,info) -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) ! If globals are 8 bytes but locals are not, things get tricky if (info == psb_success_) call psb_ensure_size(max(iszs,1),liasnd,info) if (info == psb_success_) call psb_ensure_size(max(iszs,1),ljasnd,info) @@ -540,11 +540,11 @@ Subroutine psb_ldsphalo(a,desc_a,blk,info,rowcnv,colcnv,& & rowscale,colscale,outfmt,data) use psb_base_mod, psb_protect_name => psb_ldsphalo -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -883,11 +883,11 @@ Subroutine psb_ld_csr_halo(a,desc_a,blk,info,rowcnv,colcnv,& & rowscale,colscale,data,outcol_glob,col_desc) use psb_base_mod, psb_protect_name => psb_ld_csr_halo -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -1243,11 +1243,11 @@ Subroutine psb_d_ld_csr_halo(a,desc_a,blk,info,rowcnv,colcnv,& & rowscale,colscale,data,outcol_glob,col_desc) use psb_base_mod, psb_protect_name => psb_d_ld_csr_halo -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/tools/psb_dspins.F90 b/base/tools/psb_dspins.F90 index 23cd9211..c7e05fc9 100644 --- a/base/tools/psb_dspins.F90 +++ b/base/tools/psb_dspins.F90 @@ -51,7 +51,7 @@ subroutine psb_dspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) use psb_base_mod, psb_protect_name => psb_dspins use psi_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -134,11 +134,11 @@ subroutine psb_dspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) & a_err='allocate',i_err=(/info/)) goto 9999 end if -#if 0 && defined(OPENMP) +#if defined(PSB_OPENMP) block - logical :: is_in_parallel + logical :: is_in_parallel is_in_parallel = omp_in_parallel() - if (is_in_parallel) then + if (.false..and.is_in_parallel) then !$omp parallel private(ila,jla,nrow,ncol,nnl,k) call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.) !$omp critical(spins) @@ -148,7 +148,7 @@ subroutine psb_dspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !write(0,*) me,' after g2l_ins ',psb_errstatus_fatal(),info if (info /= psb_success_) then call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='psb_cdins',i_err=(/info/)) + & a_err='g2l_ins 1',i_err=(/info/)) goto 9998 end if nrow = desc_a%get_local_rows() @@ -189,22 +189,25 @@ subroutine psb_dspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !write(0,*) me,' after csput',psb_errstatus_fatal() !$omp end parallel else + !write(0,*) me,' Before g2l ',psb_errstatus_fatal() call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.) !write(0,*) me,' Before g2l_ins ',psb_errstatus_fatal() if (info == 0) call desc_a%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info,& & mask=(ila(1:nz)>0)) !write(0,*) me,' after g2l_ins ',psb_errstatus_fatal(),info - if (info /= psb_success_) then + if ((info /= psb_success_).or.psb_errstatus_fatal()) then call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='psb_cdins',i_err=(/info/)) + & a_err='g2l_ins 2 ',i_err=(/info/)) goto 9999 end if nrow = desc_a%get_local_rows() ncol = desc_a%get_local_cols() !write(0,*) me,' Before csput',psb_errstatus_fatal() - if (a%is_bld()) then + if (a%is_bld()) then + !write(0,*) me,' before csput ',psb_errstatus_fatal(),info,nz call a%csput(nz,ila,jla,val,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then + !write(0,*) me,' after csput ',psb_errstatus_fatal(),info,nz + if ((info /= psb_success_).or.psb_errstatus_fatal()) then info=psb_err_from_subroutine_ call psb_errpush(info,name,a_err='a%csput') goto 9999 @@ -240,6 +243,11 @@ subroutine psb_dspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !write(0,*) me,' Before g2l ',psb_errstatus_fatal() call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.) + if (info /= psb_success_) then + call psb_errpush(psb_err_from_subroutine_ai_,name,& + & a_err='g2l',i_err=(/info/)) + goto 9999 + end if if (info == 0) call desc_a%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info,& & mask=(ila(1:nz)>0)) @@ -247,7 +255,7 @@ subroutine psb_dspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !write(0,*) me,' after g2l_ins ',psb_errstatus_fatal(),info if (info /= psb_success_) then call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='psb_cdins',i_err=(/info/)) + & a_err='g2l_ins',i_err=(/info/)) goto 9999 end if nrow = desc_a%get_local_rows() @@ -287,6 +295,12 @@ subroutine psb_dspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) end if #endif if (info /= 0) goto 9999 + if (psb_errstatus_fatal()) then + info = psb_err_internal_error_ + call psb_errpush(psb_err_from_subroutine_ai_,name,& + & a_err='unknown',i_err=(/info/)) + goto 9999 + end if endif else if (desc_a%is_asb()) then @@ -299,16 +313,16 @@ subroutine psb_dspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) & a_err='allocate',i_err=(/info/)) goto 9999 end if -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel private(ila,jla,nrow,ncol,nnl,k) #endif if (local_) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp workshare #endif ila(1:nz) = ia(1:nz) jla(1:nz) = ja(1:nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp end workshare #endif else @@ -341,7 +355,7 @@ subroutine psb_dspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) & 1_psb_lpk_,desc_a%get_global_rows(),info) end if end if -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp end parallel #endif @@ -458,7 +472,7 @@ subroutine psb_dspins_csr_lirp(nr,irp,ja,val,irw,a,desc_a,info,rebuild,local) end subroutine psb_dspins_csr_lirp -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_dspins_csr_iirp(nr,irw,irp,ja,val,a,desc_a,info,rebuild,local) use psb_base_mod, psb_protect_name => psb_dspins_csr_iirp use psi_mod diff --git a/base/tools/psb_e_remote_vect.F90 b/base/tools/psb_e_remote_vect.F90 index 9fb15ff9..9b190667 100644 --- a/base/tools/psb_e_remote_vect.F90 +++ b/base/tools/psb_e_remote_vect.F90 @@ -66,11 +66,11 @@ subroutine psb_e_remote_vect(n,v,iv,desc_a,x,ix, info) use psb_base_mod, psb_protect_name => psb_e_remote_vect -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_ipk_), intent(in) :: n diff --git a/base/tools/psb_i2_remote_vect.F90 b/base/tools/psb_i2_remote_vect.F90 index 3f6bffbd..11f0cb7c 100644 --- a/base/tools/psb_i2_remote_vect.F90 +++ b/base/tools/psb_i2_remote_vect.F90 @@ -66,11 +66,11 @@ subroutine psb_i2_remote_vect(n,v,iv,desc_a,x,ix, info) use psb_base_mod, psb_protect_name => psb_i2_remote_vect -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_ipk_), intent(in) :: n diff --git a/base/tools/psb_icdasb.F90 b/base/tools/psb_icdasb.F90 index 04f95738..c2d9c27a 100644 --- a/base/tools/psb_icdasb.F90 +++ b/base/tools/psb_icdasb.F90 @@ -45,11 +45,11 @@ subroutine psb_icdasb(desc,info,ext_hv,mold) use psb_base_mod, psb_protect_name => psb_icdasb use psi_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif implicit none -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif !...Parameters.... diff --git a/base/tools/psb_m_remote_vect.F90 b/base/tools/psb_m_remote_vect.F90 index 01b5aeb3..54f5ef9c 100644 --- a/base/tools/psb_m_remote_vect.F90 +++ b/base/tools/psb_m_remote_vect.F90 @@ -66,11 +66,11 @@ subroutine psb_m_remote_vect(n,v,iv,desc_a,x,ix, info) use psb_base_mod, psb_protect_name => psb_m_remote_vect -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_ipk_), intent(in) :: n diff --git a/base/tools/psb_s_glob_transpose.F90 b/base/tools/psb_s_glob_transpose.F90 index c7dc818f..8b7bff59 100644 --- a/base/tools/psb_s_glob_transpose.F90 +++ b/base/tools/psb_s_glob_transpose.F90 @@ -94,12 +94,12 @@ ! ! subroutine psb_ls_coo_glob_transpose(ain,desc_r,info,atrans,desc_c,desc_rx) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif use psb_base_mod, psb_protect_name => psb_ls_coo_glob_transpose Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_ls_coo_sparse_mat), intent(inout) :: ain @@ -392,12 +392,12 @@ subroutine psb_ls_coo_glob_transpose(ain,desc_r,info,atrans,desc_c,desc_rx) end subroutine psb_ls_coo_glob_transpose subroutine psb_s_coo_glob_transpose(ain,desc_r,info,atrans,desc_c,desc_rx) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif use psb_base_mod, psb_protect_name => psb_s_coo_glob_transpose Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_s_coo_sparse_mat), intent(inout) :: ain diff --git a/base/tools/psb_s_remote_mat.F90 b/base/tools/psb_s_remote_mat.F90 index df64266b..713f8736 100644 --- a/base/tools/psb_s_remote_mat.F90 +++ b/base/tools/psb_s_remote_mat.F90 @@ -73,11 +73,11 @@ Subroutine psb_ls_remote_mat(a,desc_a,b,info) use psb_base_mod, psb_protect_name => psb_ls_remote_mat -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/tools/psb_s_remote_vect.F90 b/base/tools/psb_s_remote_vect.F90 index a8464663..d103b694 100644 --- a/base/tools/psb_s_remote_vect.F90 +++ b/base/tools/psb_s_remote_vect.F90 @@ -66,11 +66,11 @@ subroutine psb_s_remote_vect(n,v,iv,desc_a,x,ix, info) use psb_base_mod, psb_protect_name => psb_s_remote_vect -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_ipk_), intent(in) :: n diff --git a/base/tools/psb_scdbldext.F90 b/base/tools/psb_scdbldext.F90 index 40ac778f..bdced541 100644 --- a/base/tools/psb_scdbldext.F90 +++ b/base/tools/psb_scdbldext.F90 @@ -64,11 +64,11 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype) use psb_base_mod, psb_protect_name => psb_scdbldext use psi_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/tools/psb_ssphalo.F90 b/base/tools/psb_ssphalo.F90 index be0b340a..81e9616f 100644 --- a/base/tools/psb_ssphalo.F90 +++ b/base/tools/psb_ssphalo.F90 @@ -74,11 +74,11 @@ Subroutine psb_ssphalo(a,desc_a,blk,info,rowcnv,colcnv,& & rowscale,colscale,outfmt,data) use psb_base_mod, psb_protect_name => psb_ssphalo -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -100,7 +100,7 @@ Subroutine psb_ssphalo(a,desc_a,blk,info,rowcnv,colcnv,& integer(psb_mpk_) :: icomm, minfo integer(psb_mpk_), allocatable :: brvindx(:), & & rvsz(:), bsdindx(:),sdsz(:) -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) ! If globals are 8 bytes but locals are 4, things get tricky integer(psb_ipk_), allocatable :: liasnd(:), ljasnd(:) integer(psb_lpk_), allocatable :: iasnd(:), jasnd(:), iarcv(:), jarcv(:) @@ -268,7 +268,7 @@ Subroutine psb_ssphalo(a,desc_a,blk,info,rowcnv,colcnv,& call psb_ensure_size(max(iszs,1),iasnd,info) if (info == psb_success_) call psb_ensure_size(max(iszs,1),jasnd,info) if (info == psb_success_) call psb_ensure_size(max(iszs,1),valsnd,info) -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) ! If globals are 8 bytes but locals are not, things get tricky if (info == psb_success_) call psb_ensure_size(max(iszs,1),liasnd,info) if (info == psb_success_) call psb_ensure_size(max(iszs,1),ljasnd,info) @@ -540,11 +540,11 @@ Subroutine psb_lssphalo(a,desc_a,blk,info,rowcnv,colcnv,& & rowscale,colscale,outfmt,data) use psb_base_mod, psb_protect_name => psb_lssphalo -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -883,11 +883,11 @@ Subroutine psb_ls_csr_halo(a,desc_a,blk,info,rowcnv,colcnv,& & rowscale,colscale,data,outcol_glob,col_desc) use psb_base_mod, psb_protect_name => psb_ls_csr_halo -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -1243,11 +1243,11 @@ Subroutine psb_s_ls_csr_halo(a,desc_a,blk,info,rowcnv,colcnv,& & rowscale,colscale,data,outcol_glob,col_desc) use psb_base_mod, psb_protect_name => psb_s_ls_csr_halo -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/tools/psb_sspins.F90 b/base/tools/psb_sspins.F90 index 696f756f..57a29d37 100644 --- a/base/tools/psb_sspins.F90 +++ b/base/tools/psb_sspins.F90 @@ -51,7 +51,7 @@ subroutine psb_sspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) use psb_base_mod, psb_protect_name => psb_sspins use psi_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -134,11 +134,11 @@ subroutine psb_sspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) & a_err='allocate',i_err=(/info/)) goto 9999 end if -#if 0 && defined(OPENMP) +#if defined(PSB_OPENMP) block - logical :: is_in_parallel + logical :: is_in_parallel is_in_parallel = omp_in_parallel() - if (is_in_parallel) then + if (.false..and.is_in_parallel) then !$omp parallel private(ila,jla,nrow,ncol,nnl,k) call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.) !$omp critical(spins) @@ -148,7 +148,7 @@ subroutine psb_sspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !write(0,*) me,' after g2l_ins ',psb_errstatus_fatal(),info if (info /= psb_success_) then call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='psb_cdins',i_err=(/info/)) + & a_err='g2l_ins 1',i_err=(/info/)) goto 9998 end if nrow = desc_a%get_local_rows() @@ -189,22 +189,25 @@ subroutine psb_sspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !write(0,*) me,' after csput',psb_errstatus_fatal() !$omp end parallel else + !write(0,*) me,' Before g2l ',psb_errstatus_fatal() call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.) !write(0,*) me,' Before g2l_ins ',psb_errstatus_fatal() if (info == 0) call desc_a%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info,& & mask=(ila(1:nz)>0)) !write(0,*) me,' after g2l_ins ',psb_errstatus_fatal(),info - if (info /= psb_success_) then + if ((info /= psb_success_).or.psb_errstatus_fatal()) then call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='psb_cdins',i_err=(/info/)) + & a_err='g2l_ins 2 ',i_err=(/info/)) goto 9999 end if nrow = desc_a%get_local_rows() ncol = desc_a%get_local_cols() !write(0,*) me,' Before csput',psb_errstatus_fatal() - if (a%is_bld()) then + if (a%is_bld()) then + !write(0,*) me,' before csput ',psb_errstatus_fatal(),info,nz call a%csput(nz,ila,jla,val,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then + !write(0,*) me,' after csput ',psb_errstatus_fatal(),info,nz + if ((info /= psb_success_).or.psb_errstatus_fatal()) then info=psb_err_from_subroutine_ call psb_errpush(info,name,a_err='a%csput') goto 9999 @@ -240,6 +243,11 @@ subroutine psb_sspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !write(0,*) me,' Before g2l ',psb_errstatus_fatal() call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.) + if (info /= psb_success_) then + call psb_errpush(psb_err_from_subroutine_ai_,name,& + & a_err='g2l',i_err=(/info/)) + goto 9999 + end if if (info == 0) call desc_a%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info,& & mask=(ila(1:nz)>0)) @@ -247,7 +255,7 @@ subroutine psb_sspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !write(0,*) me,' after g2l_ins ',psb_errstatus_fatal(),info if (info /= psb_success_) then call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='psb_cdins',i_err=(/info/)) + & a_err='g2l_ins',i_err=(/info/)) goto 9999 end if nrow = desc_a%get_local_rows() @@ -287,6 +295,12 @@ subroutine psb_sspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) end if #endif if (info /= 0) goto 9999 + if (psb_errstatus_fatal()) then + info = psb_err_internal_error_ + call psb_errpush(psb_err_from_subroutine_ai_,name,& + & a_err='unknown',i_err=(/info/)) + goto 9999 + end if endif else if (desc_a%is_asb()) then @@ -299,16 +313,16 @@ subroutine psb_sspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) & a_err='allocate',i_err=(/info/)) goto 9999 end if -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel private(ila,jla,nrow,ncol,nnl,k) #endif if (local_) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp workshare #endif ila(1:nz) = ia(1:nz) jla(1:nz) = ja(1:nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp end workshare #endif else @@ -341,7 +355,7 @@ subroutine psb_sspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) & 1_psb_lpk_,desc_a%get_global_rows(),info) end if end if -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp end parallel #endif @@ -458,7 +472,7 @@ subroutine psb_sspins_csr_lirp(nr,irp,ja,val,irw,a,desc_a,info,rebuild,local) end subroutine psb_sspins_csr_lirp -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_sspins_csr_iirp(nr,irw,irp,ja,val,a,desc_a,info,rebuild,local) use psb_base_mod, psb_protect_name => psb_sspins_csr_iirp use psi_mod diff --git a/base/tools/psb_z_glob_transpose.F90 b/base/tools/psb_z_glob_transpose.F90 index 9bc92da3..df86635b 100644 --- a/base/tools/psb_z_glob_transpose.F90 +++ b/base/tools/psb_z_glob_transpose.F90 @@ -94,12 +94,12 @@ ! ! subroutine psb_lz_coo_glob_transpose(ain,desc_r,info,atrans,desc_c,desc_rx) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif use psb_base_mod, psb_protect_name => psb_lz_coo_glob_transpose Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_lz_coo_sparse_mat), intent(inout) :: ain @@ -392,12 +392,12 @@ subroutine psb_lz_coo_glob_transpose(ain,desc_r,info,atrans,desc_c,desc_rx) end subroutine psb_lz_coo_glob_transpose subroutine psb_z_coo_glob_transpose(ain,desc_r,info,atrans,desc_c,desc_rx) -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif use psb_base_mod, psb_protect_name => psb_z_coo_glob_transpose Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif type(psb_z_coo_sparse_mat), intent(inout) :: ain diff --git a/base/tools/psb_z_remote_mat.F90 b/base/tools/psb_z_remote_mat.F90 index 5461c5d5..a9dc1721 100644 --- a/base/tools/psb_z_remote_mat.F90 +++ b/base/tools/psb_z_remote_mat.F90 @@ -73,11 +73,11 @@ Subroutine psb_lz_remote_mat(a,desc_a,b,info) use psb_base_mod, psb_protect_name => psb_lz_remote_mat -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/tools/psb_z_remote_vect.F90 b/base/tools/psb_z_remote_vect.F90 index ed705bb5..9670598a 100644 --- a/base/tools/psb_z_remote_vect.F90 +++ b/base/tools/psb_z_remote_vect.F90 @@ -66,11 +66,11 @@ subroutine psb_z_remote_vect(n,v,iv,desc_a,x,ix, info) use psb_base_mod, psb_protect_name => psb_z_remote_vect -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif integer(psb_ipk_), intent(in) :: n diff --git a/base/tools/psb_zcdbldext.F90 b/base/tools/psb_zcdbldext.F90 index 32d0b51a..29b93c5b 100644 --- a/base/tools/psb_zcdbldext.F90 +++ b/base/tools/psb_zcdbldext.F90 @@ -64,11 +64,11 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype) use psb_base_mod, psb_protect_name => psb_zcdbldext use psi_mod -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/tools/psb_zsphalo.F90 b/base/tools/psb_zsphalo.F90 index 5e24a93c..6d814b39 100644 --- a/base/tools/psb_zsphalo.F90 +++ b/base/tools/psb_zsphalo.F90 @@ -74,11 +74,11 @@ Subroutine psb_zsphalo(a,desc_a,blk,info,rowcnv,colcnv,& & rowscale,colscale,outfmt,data) use psb_base_mod, psb_protect_name => psb_zsphalo -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -100,7 +100,7 @@ Subroutine psb_zsphalo(a,desc_a,blk,info,rowcnv,colcnv,& integer(psb_mpk_) :: icomm, minfo integer(psb_mpk_), allocatable :: brvindx(:), & & rvsz(:), bsdindx(:),sdsz(:) -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) ! If globals are 8 bytes but locals are 4, things get tricky integer(psb_ipk_), allocatable :: liasnd(:), ljasnd(:) integer(psb_lpk_), allocatable :: iasnd(:), jasnd(:), iarcv(:), jarcv(:) @@ -268,7 +268,7 @@ Subroutine psb_zsphalo(a,desc_a,blk,info,rowcnv,colcnv,& call psb_ensure_size(max(iszs,1),iasnd,info) if (info == psb_success_) call psb_ensure_size(max(iszs,1),jasnd,info) if (info == psb_success_) call psb_ensure_size(max(iszs,1),valsnd,info) -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) ! If globals are 8 bytes but locals are not, things get tricky if (info == psb_success_) call psb_ensure_size(max(iszs,1),liasnd,info) if (info == psb_success_) call psb_ensure_size(max(iszs,1),ljasnd,info) @@ -540,11 +540,11 @@ Subroutine psb_lzsphalo(a,desc_a,blk,info,rowcnv,colcnv,& & rowscale,colscale,outfmt,data) use psb_base_mod, psb_protect_name => psb_lzsphalo -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -883,11 +883,11 @@ Subroutine psb_lz_csr_halo(a,desc_a,blk,info,rowcnv,colcnv,& & rowscale,colscale,data,outcol_glob,col_desc) use psb_base_mod, psb_protect_name => psb_lz_csr_halo -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif @@ -1243,11 +1243,11 @@ Subroutine psb_z_lz_csr_halo(a,desc_a,blk,info,rowcnv,colcnv,& & rowscale,colscale,data,outcol_glob,col_desc) use psb_base_mod, psb_protect_name => psb_z_lz_csr_halo -#ifdef MPI_MOD +#ifdef PSB_MPI_MOD use mpi #endif Implicit None -#ifdef MPI_H +#ifdef PSB_MPI_H include 'mpif.h' #endif diff --git a/base/tools/psb_zspins.F90 b/base/tools/psb_zspins.F90 index 3b33d80f..43191bbe 100644 --- a/base/tools/psb_zspins.F90 +++ b/base/tools/psb_zspins.F90 @@ -51,7 +51,7 @@ subroutine psb_zspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) use psb_base_mod, psb_protect_name => psb_zspins use psi_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -134,11 +134,11 @@ subroutine psb_zspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) & a_err='allocate',i_err=(/info/)) goto 9999 end if -#if 0 && defined(OPENMP) +#if defined(PSB_OPENMP) block - logical :: is_in_parallel + logical :: is_in_parallel is_in_parallel = omp_in_parallel() - if (is_in_parallel) then + if (.false..and.is_in_parallel) then !$omp parallel private(ila,jla,nrow,ncol,nnl,k) call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.) !$omp critical(spins) @@ -148,7 +148,7 @@ subroutine psb_zspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !write(0,*) me,' after g2l_ins ',psb_errstatus_fatal(),info if (info /= psb_success_) then call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='psb_cdins',i_err=(/info/)) + & a_err='g2l_ins 1',i_err=(/info/)) goto 9998 end if nrow = desc_a%get_local_rows() @@ -189,22 +189,25 @@ subroutine psb_zspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !write(0,*) me,' after csput',psb_errstatus_fatal() !$omp end parallel else + !write(0,*) me,' Before g2l ',psb_errstatus_fatal() call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.) !write(0,*) me,' Before g2l_ins ',psb_errstatus_fatal() if (info == 0) call desc_a%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info,& & mask=(ila(1:nz)>0)) !write(0,*) me,' after g2l_ins ',psb_errstatus_fatal(),info - if (info /= psb_success_) then + if ((info /= psb_success_).or.psb_errstatus_fatal()) then call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='psb_cdins',i_err=(/info/)) + & a_err='g2l_ins 2 ',i_err=(/info/)) goto 9999 end if nrow = desc_a%get_local_rows() ncol = desc_a%get_local_cols() !write(0,*) me,' Before csput',psb_errstatus_fatal() - if (a%is_bld()) then + if (a%is_bld()) then + !write(0,*) me,' before csput ',psb_errstatus_fatal(),info,nz call a%csput(nz,ila,jla,val,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then + !write(0,*) me,' after csput ',psb_errstatus_fatal(),info,nz + if ((info /= psb_success_).or.psb_errstatus_fatal()) then info=psb_err_from_subroutine_ call psb_errpush(info,name,a_err='a%csput') goto 9999 @@ -240,6 +243,11 @@ subroutine psb_zspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !write(0,*) me,' Before g2l ',psb_errstatus_fatal() call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.) + if (info /= psb_success_) then + call psb_errpush(psb_err_from_subroutine_ai_,name,& + & a_err='g2l',i_err=(/info/)) + goto 9999 + end if if (info == 0) call desc_a%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info,& & mask=(ila(1:nz)>0)) @@ -247,7 +255,7 @@ subroutine psb_zspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !write(0,*) me,' after g2l_ins ',psb_errstatus_fatal(),info if (info /= psb_success_) then call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='psb_cdins',i_err=(/info/)) + & a_err='g2l_ins',i_err=(/info/)) goto 9999 end if nrow = desc_a%get_local_rows() @@ -287,6 +295,12 @@ subroutine psb_zspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) end if #endif if (info /= 0) goto 9999 + if (psb_errstatus_fatal()) then + info = psb_err_internal_error_ + call psb_errpush(psb_err_from_subroutine_ai_,name,& + & a_err='unknown',i_err=(/info/)) + goto 9999 + end if endif else if (desc_a%is_asb()) then @@ -299,16 +313,16 @@ subroutine psb_zspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) & a_err='allocate',i_err=(/info/)) goto 9999 end if -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp parallel private(ila,jla,nrow,ncol,nnl,k) #endif if (local_) then -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp workshare #endif ila(1:nz) = ia(1:nz) jla(1:nz) = ja(1:nz) -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp end workshare #endif else @@ -341,7 +355,7 @@ subroutine psb_zspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) & 1_psb_lpk_,desc_a%get_global_rows(),info) end if end if -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$omp end parallel #endif @@ -458,7 +472,7 @@ subroutine psb_zspins_csr_lirp(nr,irp,ja,val,irw,a,desc_a,info,rebuild,local) end subroutine psb_zspins_csr_lirp -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine psb_zspins_csr_iirp(nr,irw,irp,ja,val,a,desc_a,info,rebuild,local) use psb_base_mod, psb_protect_name => psb_zspins_csr_iirp use psi_mod diff --git a/cbind/base/psb_c_tools_cbind_mod.F90 b/cbind/base/psb_c_tools_cbind_mod.F90 index 8f64cbb0..b7895de2 100644 --- a/cbind/base/psb_c_tools_cbind_mod.F90 +++ b/cbind/base/psb_c_tools_cbind_mod.F90 @@ -292,7 +292,7 @@ contains function psb_c_cspasb_opt(mh,cdh,afmt,upd) bind(c) result(res) -#ifdef HAVE_LIBRSB +#ifdef PSB_HAVE_LIBRSB use psb_c_rsb_mat_mod #endif implicit none @@ -301,7 +301,7 @@ contains character(c_char) :: afmt(*) integer(psb_c_ipk_) :: info,n character(len=5) :: fafmt -#ifdef HAVE_LIBRSB +#ifdef PSB_HAVE_LIBRSB type(psb_c_rsb_sparse_mat) :: arsb #endif @@ -313,7 +313,7 @@ contains call stringc2f(afmt,fafmt) select case(fafmt) -#ifdef HAVE_LIBRSB +#ifdef PSB_HAVE_LIBRSB case('RSB') call psb_spasb(double_spmat_pool(mh)%item,descriptor_pool(cdh)%item,info,& & upd=upd,mold=arsb) diff --git a/cbind/base/psb_d_tools_cbind_mod.F90 b/cbind/base/psb_d_tools_cbind_mod.F90 index 67ae8b86..2de6990c 100644 --- a/cbind/base/psb_d_tools_cbind_mod.F90 +++ b/cbind/base/psb_d_tools_cbind_mod.F90 @@ -292,7 +292,7 @@ contains function psb_c_dspasb_opt(mh,cdh,afmt,upd) bind(c) result(res) -#ifdef HAVE_LIBRSB +#ifdef PSB_HAVE_LIBRSB use psb_d_rsb_mat_mod #endif implicit none @@ -301,7 +301,7 @@ contains character(c_char) :: afmt(*) integer(psb_c_ipk_) :: info,n character(len=5) :: fafmt -#ifdef HAVE_LIBRSB +#ifdef PSB_HAVE_LIBRSB type(psb_d_rsb_sparse_mat) :: arsb #endif @@ -313,7 +313,7 @@ contains call stringc2f(afmt,fafmt) select case(fafmt) -#ifdef HAVE_LIBRSB +#ifdef PSB_HAVE_LIBRSB case('RSB') call psb_spasb(double_spmat_pool(mh)%item,descriptor_pool(cdh)%item,info,& & upd=upd,mold=arsb) diff --git a/cbind/base/psb_s_tools_cbind_mod.F90 b/cbind/base/psb_s_tools_cbind_mod.F90 index 91d9b322..517ad361 100644 --- a/cbind/base/psb_s_tools_cbind_mod.F90 +++ b/cbind/base/psb_s_tools_cbind_mod.F90 @@ -292,7 +292,7 @@ contains function psb_c_sspasb_opt(mh,cdh,afmt,upd) bind(c) result(res) -#ifdef HAVE_LIBRSB +#ifdef PSB_HAVE_LIBRSB use psb_s_rsb_mat_mod #endif implicit none @@ -301,7 +301,7 @@ contains character(c_char) :: afmt(*) integer(psb_c_ipk_) :: info,n character(len=5) :: fafmt -#ifdef HAVE_LIBRSB +#ifdef PSB_HAVE_LIBRSB type(psb_s_rsb_sparse_mat) :: arsb #endif @@ -313,7 +313,7 @@ contains call stringc2f(afmt,fafmt) select case(fafmt) -#ifdef HAVE_LIBRSB +#ifdef PSB_HAVE_LIBRSB case('RSB') call psb_spasb(double_spmat_pool(mh)%item,descriptor_pool(cdh)%item,info,& & upd=upd,mold=arsb) diff --git a/cbind/base/psb_z_tools_cbind_mod.F90 b/cbind/base/psb_z_tools_cbind_mod.F90 index 59d4cca8..3e94b715 100644 --- a/cbind/base/psb_z_tools_cbind_mod.F90 +++ b/cbind/base/psb_z_tools_cbind_mod.F90 @@ -292,7 +292,7 @@ contains function psb_c_zspasb_opt(mh,cdh,afmt,upd) bind(c) result(res) -#ifdef HAVE_LIBRSB +#ifdef PSB_HAVE_LIBRSB use psb_z_rsb_mat_mod #endif implicit none @@ -301,7 +301,7 @@ contains character(c_char) :: afmt(*) integer(psb_c_ipk_) :: info,n character(len=5) :: fafmt -#ifdef HAVE_LIBRSB +#ifdef PSB_HAVE_LIBRSB type(psb_z_rsb_sparse_mat) :: arsb #endif @@ -313,7 +313,7 @@ contains call stringc2f(afmt,fafmt) select case(fafmt) -#ifdef HAVE_LIBRSB +#ifdef PSB_HAVE_LIBRSB case('RSB') call psb_spasb(double_spmat_pool(mh)%item,descriptor_pool(cdh)%item,info,& & upd=upd,mold=arsb) diff --git a/configure b/configure index c512d094..620705b1 100755 --- a/configure +++ b/configure @@ -663,8 +663,8 @@ CUDALD CUDAD CUDEFINES CUDA_NVCC -CUDA_SHORT_VERSION -CUDA_VERSION +PSB_CUDA_SHORT_VERSION +PSB_CUDA_VERSION CUDA_LIBS CUDA_INCLUDES CXXCUDEFINES @@ -695,10 +695,10 @@ CHAVEAMD CREALMETIS CINTMETIS CHAVEMETIS -CHAVEOPENMP +CHAVE_OPENMP CSERIALMPI -LPKDEF -IPKDEF +PSB_LPKDEF +PSB_IPKDEF FINCLUDES CINCLUDES METIS_LIBS @@ -4648,7 +4648,7 @@ if test x"$pac_cv_serial_mpi" == x"yes" ; then MPIFC="$FC"; MPICC="$CC"; MPICXX="$CXX"; - CSERIALMPI="#define SERIAL_MPI" + CSERIALMPI="#define PSB_SERIAL_MPI" else ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -7286,7 +7286,7 @@ fi ############################################################################### # Custom test : do we have a module or include for MPI Fortran interface? if test x"$pac_cv_serial_mpi" == x"yes" ; then - FDEFINES="$psblas_cv_define_prepend-DSERIAL_MPI $psblas_cv_define_prepend-DMPI_MOD $FDEFINES"; + FDEFINES="$psblas_cv_define_prepend-DPSB_SERIAL_MPI $psblas_cv_define_prepend-DPSB_MPI_MOD $FDEFINES"; else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking MPI Fortran 2008 interface" >&5 printf %s "checking MPI Fortran 2008 interface... " >&6; } @@ -7327,7 +7327,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test x"$pac_cv_mpi_f08" == x"yes" ; then - FDEFINES="$psblas_cv_define_prepend-DMPI_MOD $FDEFINES"; + FDEFINES="$psblas_cv_define_prepend-DPSB_MPI_MOD $FDEFINES"; else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran MPI mod" >&5 printf %s "checking for Fortran MPI mod... " >&6; } @@ -7349,13 +7349,13 @@ if ac_fn_fc_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - FDEFINES="$psblas_cv_define_prepend-DMPI_MOD $FDEFINES" + FDEFINES="$psblas_cv_define_prepend-DPSB_MPI_MOD $FDEFINES" else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - FDEFINES="$psblas_cv_define_prepend-DMPI_H $FDEFINES" + FDEFINES="$psblas_cv_define_prepend-DPSB_MPI_H $FDEFINES" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=c @@ -7414,25 +7414,25 @@ printf "%s\n" "Unsupported value for LPK: $pac_cv_lpk_size, defaulting to 8." >& fi -# Defaults for IPK/LPK +# Defaults for PSB_IPK/PSB_LPK if test x"$pac_cv_ipk_size" == x"" ; then pac_cv_ipk_size=4 fi if test x"$pac_cv_lpk_size" == x"" ; then pac_cv_lpk_size=8 fi -IPKDEF="#define IPK$pac_cv_ipk_size" -LPKDEF="#define LPK$pac_cv_lpk_size" +PSB_IPKDEF="#define PSB_IPK$pac_cv_ipk_size" +PSB_LPKDEF="#define PSB_LPK$pac_cv_lpk_size" # Enforce sensible combination if (( $pac_cv_lpk_size < $pac_cv_ipk_size )); then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Invalid combination of size specs IPK ${pac_cv_ipk_size} LPK ${pac_cv_lpk_size}. " >&5 -printf "%s\n" "$as_me: Invalid combination of size specs IPK ${pac_cv_ipk_size} LPK ${pac_cv_lpk_size}. " >&6;}; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Invalid combination of size specs PSB_IPK ${pac_cv_ipk_size} PSB_LPK ${pac_cv_lpk_size}. " >&5 +printf "%s\n" "$as_me: Invalid combination of size specs PSB_IPK ${pac_cv_ipk_size} PSB_LPK ${pac_cv_lpk_size}. " >&6;}; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Forcing equal values" >&5 printf "%s\n" "$as_me: Forcing equal values" >&6;} pac_cv_lpk_size=$pac_cv_ipk_size; fi -FDEFINES="$psblas_cv_define_prepend-DIPK${pac_cv_ipk_size} $FDEFINES"; -FDEFINES="$psblas_cv_define_prepend-DLPK${pac_cv_lpk_size} $FDEFINES"; +FDEFINES="$psblas_cv_define_prepend-DPSB_IPK${pac_cv_ipk_size} $FDEFINES"; +FDEFINES="$psblas_cv_define_prepend-DPSB_LPK${pac_cv_lpk_size} $FDEFINES"; FLINK="$MPIFC" if test -e penmp || test -e mp; then @@ -7720,9 +7720,9 @@ fi if test x"$pac_cv_openmp" == x"yes" ; then - FDEFINES="$psblas_cv_define_prepend-DOPENMP $FDEFINES"; + FDEFINES="$psblas_cv_define_prepend-DPSB_OPENMP $FDEFINES"; CDEFINES="$CDEFINES"; - CHAVEOPENMP="#define OPENMP" + CHAVE_OPENMP="#define PSB_OPENMP" FCOPT="$FCOPT $pac_cv_openmp_fcopt"; CCOPT="$CCOPT $pac_cv_openmp_ccopt"; CXXOPT="$CXXOPT $pac_cv_openmp_cxxopt"; @@ -8381,7 +8381,7 @@ else $as_nop printf "%s\n" "no" >&6; } echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - FDEFINES="$psblas_cv_define_prepend-DHAVE_BUGGY_GENERICS $FDEFINES" + FDEFINES="$psblas_cv_define_prepend-DPSB_HAVE_BUGGY_GENERICS $FDEFINES" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -8417,7 +8417,7 @@ if ac_fn_fc_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - FDEFINES="$psblas_cv_define_prepend-DHAVE_FLUSH_STMT $FDEFINES" + FDEFINES="$psblas_cv_define_prepend-DPSB_HAVE_FLUSH_STMT $FDEFINES" else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } @@ -9698,7 +9698,7 @@ done # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$pac_lapack_ok" = xyes; then - FDEFINES="$psblas_cv_define_prepend-DHAVE_LAPACK $FDEFINES" + FDEFINES="$psblas_cv_define_prepend-DPSB_HAVE_LAPACK $FDEFINES" : else pac_lapack_ok=no @@ -10128,8 +10128,8 @@ LIBS="$SAVE_LIBS"; CPPFLAGS="$SAVE_CPPFLAGS"; -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Compatibility between metis and LPK" >&5 -printf %s "checking Compatibility between metis and LPK... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Compatibility between metis and PSB_LPK" >&5 +printf %s "checking Compatibility between metis and PSB_LPK... " >&6; } if test "x$pac_cv_lpk_size" == "x4" ; then if test "x$pac_cv_metis_idx" == "x64" ; then psblas_cv_have_metis="no"; @@ -10154,12 +10154,12 @@ printf "%s\n" "$as_me: Unknown METIS REAL bitsize." >&6;} $psblas_cv_have_metis = "no"; fi if test "x$psblas_cv_have_metis" == "xyes" ; then - FDEFINES="$psblas_cv_define_prepend-DHAVE_METIS $psblas_cv_define_prepend-DMETIS_$pac_cv_metis_idx $psblas_cv_define_prepend-DMETIS_REAL_$pac_cv_metis_real $FDEFINES" - # CDEFINES="-DHAVE_METIS_ $psblas_cv_metis_includes $CDEFINES -DMETIS_$pac_cv_metis_idx -DMETIS_REAL_$pac_cv_metis_real" + FDEFINES="$psblas_cv_define_prepend-DPSB_HAVE_METIS $psblas_cv_define_prepend-DPSB_METIS_$pac_cv_metis_idx $psblas_cv_define_prepend-DPSB_METIS_REAL_$pac_cv_metis_real $FDEFINES" + CDEFINES="$psblas_cv_metis_includes $CDEFINES" METISINCFILE=$psblas_cv_metisincfile - CHAVEMETIS="#define HAVE_METIS" - CINTMETIS="#define METIS_$pac_cv_metis_idx" - CREALMETIS="#define METIS_REAL_$pac_cv_metis_real" + CHAVEMETIS="#define PSB_HAVE_METIS" + CINTMETIS="#define PSB_METIS_$pac_cv_metis_idx" + CREALMETIS="#define PSB_METIS_REAL_$pac_cv_metis_real" fi @@ -10368,9 +10368,9 @@ LIBS="$SAVE_LIBS"; CPPFLAGS="$SAVE_CPPFLAGS"; if test "x$psblas_cv_have_amd" == "xyes" ; then - FDEFINES="$psblas_cv_define_prepend-DHAVE_AMD $FDEFINES" - # CDEFINES="-DHAVE_AMD_ $psblas_cv_amd_includes $CDEFINES" - CHAVEAMD="#define HAVE_AMD_" + FDEFINES="$psblas_cv_define_prepend-DPSB_HAVE_AMD $FDEFINES" + CDEFINES="$psblas_cv_amd_includes $CDEFINES" + CHAVEAMD="#define PSB_HAVE_AMD" fi @@ -10392,7 +10392,7 @@ if test "x$pac_cv_ipk_size" != "x4"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: For CUDA I need psb_ipk_ to be 4 bytes but it is $pac_cv_ipk_size, disabling CUDA/SPGPU" >&5 printf "%s\n" "$as_me: For CUDA I need psb_ipk_ to be 4 bytes but it is $pac_cv_ipk_size, disabling CUDA/SPGPU" >&6;} pac_cv_cuda="no"; - HAVE_CUDA="no"; + PSB_HAVE_CUDA="no"; CUDA_CC=""; SPGPU_LIBS=""; CUDAD=""; @@ -10617,13 +10617,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu LIBS="$SAVE_LIBS" CPPFLAGS="$SAVE_CPPFLAGS" - HAVE_CUDA="yes"; - CUDA_VERSION="$pac_cv_cuda_version"; - CUDA_SHORT_VERSION=$(expr $pac_cv_cuda_version / 1000); - CUDA_DEFINES="-DHAVE_CUDA -DCUDA_SHORT_VERSION=${CUDA_SHORT_VERSION} -DCUDA_VERSION=${CUDA_VERSION}"; - CHAVECUDA="#define HAVE_CUDA" - CSHORTVCUDA="#define CUDA_SHORT_VERSION ${CUDA_SHORT_VERSION}" - CVERSIONCUDA="#define CUDA_VERSION ${CUDA_VERSION}" + PSB_HAVE_CUDA="yes"; + PSB_CUDA_VERSION="$pac_cv_cuda_version"; + PSB_CUDA_SHORT_VERSION=$(expr $pac_cv_cuda_version / 1000); + CUDA_DEFINES="-DPSB_HAVE_CUDA -DPSB_CUDA_SHORT_VERSION=${PSB_CUDA_SHORT_VERSION} -DPSB_CUDA_VERSION=${PSB_CUDA_VERSION}"; + CHAVECUDA="#define PSB_HAVE_CUDA" + CSHORTVCUDA="#define PSB_CUDA_SHORT_VERSION ${PSB_CUDA_SHORT_VERSION}" + CVERSIONCUDA="#define PSB_CUDA_VERSION ${PSB_CUDA_VERSION}" SPGPU_LIBS="-lspgpu"; CUDAD=cudad; CUDALD=cudald; @@ -11060,7 +11060,7 @@ else printf "%s\n" "$LIBRSB_DIR" >&6; } RSBTARGETLIB=rsbd; RSBTARGETOBJ=rsbobj; - CHAVELIBRSB="#define HAVE_LIBRSB" + CHAVELIBRSB="#define PSB_HAVE_LIBRSB" fi @@ -11125,7 +11125,7 @@ UTILLIBNAME=libpsb_util.a PSBLASRULES=' -PSBLDLIBS=$(LAPACK) $(BLAS) $(METIS_LIB) $(AMD_LIB) $(FLIBS) $(LIBS) +PSBLDLIBS=$(LAPACK) $(BLAS) $(PSB_METIS_LIB) $(AMD_LIB) $(FLIBS) $(LIBS) CXXDEFINES=$(PSBCXXDEFINES) CDEFINES=$(PSBCDEFINES) FDEFINES=$(PSBFDEFINES) @@ -12525,7 +12525,7 @@ fi FCOPT : ${FCOPT} CCOPT : ${CCOPT} - CUDA : ${HAVE_CUDA} + CUDA : ${PSB_HAVE_CUDA} CUDA_CC : ${pac_cv_cudacc} OPENACC : ${pac_cv_openacc} @@ -12563,7 +12563,7 @@ printf "%s\n" "$as_me: FCOPT : ${FCOPT} CCOPT : ${CCOPT} - CUDA : ${HAVE_CUDA} + CUDA : ${PSB_HAVE_CUDA} CUDA_CC : ${pac_cv_cudacc} OPENACC : ${pac_cv_openacc} diff --git a/configure.ac b/configure.ac old mode 100755 new mode 100644 index c8897551..df1d23f6 --- a/configure.ac +++ b/configure.ac @@ -140,7 +140,7 @@ if test x"$pac_cv_serial_mpi" == x"yes" ; then MPIFC="$FC"; MPICC="$CC"; MPICXX="$CXX"; - CSERIALMPI="#define SERIAL_MPI" + CSERIALMPI="#define PSB_SERIAL_MPI" else AC_LANG([C]) if test "X$MPICC" = "X" ; then @@ -540,47 +540,47 @@ fi ############################################################################### # Custom test : do we have a module or include for MPI Fortran interface? if test x"$pac_cv_serial_mpi" == x"yes" ; then - FDEFINES="$psblas_cv_define_prepend-DSERIAL_MPI $psblas_cv_define_prepend-DMPI_MOD $FDEFINES"; - dnl CDEFINES="-DSERIAL_MPI $CDEFINES" + FDEFINES="$psblas_cv_define_prepend-DPSB_SERIAL_MPI $psblas_cv_define_prepend-DPSB_MPI_MOD $FDEFINES"; + dnl CDEFINES="-DPSB_SERIAL_MPI $CDEFINES" else PAC_FORTRAN_CHECK_HAVE_MPI_MOD_F08() if test x"$pac_cv_mpi_f08" == x"yes" ; then -dnl FDEFINES="$psblas_cv_define_prepend-DMPI_MOD_F08 $FDEFINES"; - FDEFINES="$psblas_cv_define_prepend-DMPI_MOD $FDEFINES"; +dnl FDEFINES="$psblas_cv_define_prepend-DPSB_MPI_MOD_F08 $FDEFINES"; + FDEFINES="$psblas_cv_define_prepend-DPSB_MPI_MOD $FDEFINES"; else PAC_FORTRAN_CHECK_HAVE_MPI_MOD( - [FDEFINES="$psblas_cv_define_prepend-DMPI_MOD $FDEFINES"], - [FDEFINES="$psblas_cv_define_prepend-DMPI_H $FDEFINES"]) + [FDEFINES="$psblas_cv_define_prepend-DPSB_MPI_MOD $FDEFINES"], + [FDEFINES="$psblas_cv_define_prepend-DPSB_MPI_H $FDEFINES"]) fi fi PAC_ARG_WITH_IPK PAC_ARG_WITH_LPK -# Defaults for IPK/LPK +# Defaults for PSB_IPK/PSB_LPK if test x"$pac_cv_ipk_size" == x"" ; then pac_cv_ipk_size=4 fi if test x"$pac_cv_lpk_size" == x"" ; then pac_cv_lpk_size=8 fi -IPKDEF="#define IPK$pac_cv_ipk_size" -LPKDEF="#define LPK$pac_cv_lpk_size" +PSB_IPKDEF="#define PSB_IPK$pac_cv_ipk_size" +PSB_LPKDEF="#define PSB_LPK$pac_cv_lpk_size" # Enforce sensible combination if (( $pac_cv_lpk_size < $pac_cv_ipk_size )); then - AC_MSG_NOTICE([[Invalid combination of size specs IPK ${pac_cv_ipk_size} LPK ${pac_cv_lpk_size}. ]]); + AC_MSG_NOTICE([[Invalid combination of size specs PSB_IPK ${pac_cv_ipk_size} PSB_LPK ${pac_cv_lpk_size}. ]]); AC_MSG_NOTICE([[Forcing equal values]]) pac_cv_lpk_size=$pac_cv_ipk_size; fi -FDEFINES="$psblas_cv_define_prepend-DIPK${pac_cv_ipk_size} $FDEFINES"; -FDEFINES="$psblas_cv_define_prepend-DLPK${pac_cv_lpk_size} $FDEFINES"; -dnl CDEFINES="-DIPK${pac_cv_ipk_size} -DLPK${pac_cv_lpk_size} $CDEFINES" +FDEFINES="$psblas_cv_define_prepend-DPSB_IPK${pac_cv_ipk_size} $FDEFINES"; +FDEFINES="$psblas_cv_define_prepend-DPSB_LPK${pac_cv_lpk_size} $FDEFINES"; +dnl CDEFINES="-DPSB_IPK${pac_cv_ipk_size} -DPSB_LPK${pac_cv_lpk_size} $CDEFINES" FLINK="$MPIFC" PAC_ARG_OPENMP() if test x"$pac_cv_openmp" == x"yes" ; then - FDEFINES="$psblas_cv_define_prepend-DOPENMP $FDEFINES"; + FDEFINES="$psblas_cv_define_prepend-DPSB_OPENMP $FDEFINES"; CDEFINES="$CDEFINES"; - CHAVEOPENMP="#define OPENMP" + CHAVE_OPENMP="#define PSB_OPENMP" FCOPT="$FCOPT $pac_cv_openmp_fcopt"; CCOPT="$CCOPT $pac_cv_openmp_ccopt"; CXXOPT="$CXXOPT $pac_cv_openmp_cxxopt"; @@ -671,11 +671,11 @@ PAC_FORTRAN_TEST_FINAL( PAC_FORTRAN_TEST_GENERICS( [], - [FDEFINES="$psblas_cv_define_prepend-DHAVE_BUGGY_GENERICS $FDEFINES"] + [FDEFINES="$psblas_cv_define_prepend-DPSB_HAVE_BUGGY_GENERICS $FDEFINES"] ) PAC_FORTRAN_TEST_FLUSH( - [FDEFINES="$psblas_cv_define_prepend-DHAVE_FLUSH_STMT $FDEFINES"], + [FDEFINES="$psblas_cv_define_prepend-DPSB_HAVE_FLUSH_STMT $FDEFINES"], ) @@ -728,7 +728,7 @@ AR="${AR} -cDr" PAC_BLAS([], [AC_MSG_ERROR([[Cannot find BLAS library, specify a path using --with-blas=DIR/LIB (for example --with-blas=/usr/path/lib/libcxml.a)]])]) PAC_LAPACK( -[FDEFINES="$psblas_cv_define_prepend-DHAVE_LAPACK $FDEFINES"], +[FDEFINES="$psblas_cv_define_prepend-DPSB_HAVE_LAPACK $FDEFINES"], ) AC_LANG([C]) @@ -774,7 +774,7 @@ dnl true; dnl # we assume want_rsb_libs are linkage parameters dnl fi dnl fi -dnl FDEFINES="$FDEFINES $psblas_cv_define_prepend-DHAVE_LIBRSB" +dnl FDEFINES="$FDEFINES $psblas_cv_define_prepend-DPSB_HAVE_LIBRSB" dnl fi dnl RSB_LIBS="$want_rsb_libs" dnl LIBS="$RSB_LIBS ${LIBS}" @@ -782,46 +782,46 @@ dnl AC_CHECK_HEADERS([rsb.h], [ LIBS="${LIBS} $want_rsb_libs"], []) PAC_CHECK_METIS -AC_MSG_CHECKING([Compatibility between metis and LPK]) +AC_MSG_CHECKING([Compatibility between metis and PSB_LPK]) if test "x$pac_cv_lpk_size" == "x4" ; then if test "x$pac_cv_metis_idx" == "x64" ; then - dnl mismatch between metis size and PSBLAS LPK + dnl mismatch between metis size and PSBLAS PSB_LPK psblas_cv_have_metis="no"; dnl fi fi if test "x$pac_cv_lpk_size" == "x8" ; then if test "x$pac_cv_metis_idx" == "x32" ; then - dnl mismatch between metis size and PSBLAS LPK + dnl mismatch between metis size and PSBLAS PSB_LPK psblas_cv_have_metis="no"; fi fi AC_MSG_RESULT([$psblas_cv_have_metis]) if test "x$pac_cv_metis_idx" == "xunknown" ; then - dnl mismatch between metis size and PSBLAS LPK + dnl mismatch between metis size and PSBLAS PSB_LPK AC_MSG_NOTICE([Unknown METIS bitsize.]) $psblas_cv_have_metis = "no"; fi if test "x$pac_cv_metis_real" == "xunknown" ; then - dnl mismatch between metis size and PSBLAS LPK + dnl mismatch between metis size and PSBLAS PSB_LPK AC_MSG_NOTICE([Unknown METIS REAL bitsize.]) $psblas_cv_have_metis = "no"; fi if test "x$psblas_cv_have_metis" == "xyes" ; then - FDEFINES="$psblas_cv_define_prepend-DHAVE_METIS $psblas_cv_define_prepend-DMETIS_$pac_cv_metis_idx $psblas_cv_define_prepend-DMETIS_REAL_$pac_cv_metis_real $FDEFINES" - # CDEFINES="-DHAVE_METIS_ $psblas_cv_metis_includes $CDEFINES -DMETIS_$pac_cv_metis_idx -DMETIS_REAL_$pac_cv_metis_real" + FDEFINES="$psblas_cv_define_prepend-DPSB_HAVE_METIS $psblas_cv_define_prepend-DPSB_METIS_$pac_cv_metis_idx $psblas_cv_define_prepend-DPSB_METIS_REAL_$pac_cv_metis_real $FDEFINES" + CDEFINES="$psblas_cv_metis_includes $CDEFINES" METISINCFILE=$psblas_cv_metisincfile - CHAVEMETIS="#define HAVE_METIS" - CINTMETIS="#define METIS_$pac_cv_metis_idx" - CREALMETIS="#define METIS_REAL_$pac_cv_metis_real" + CHAVEMETIS="#define PSB_HAVE_METIS" + CINTMETIS="#define PSB_METIS_$pac_cv_metis_idx" + CREALMETIS="#define PSB_METIS_REAL_$pac_cv_metis_real" fi PAC_CHECK_AMD if test "x$psblas_cv_have_amd" == "xyes" ; then - FDEFINES="$psblas_cv_define_prepend-DHAVE_AMD $FDEFINES" - # CDEFINES="-DHAVE_AMD_ $psblas_cv_amd_includes $CDEFINES" - CHAVEAMD="#define HAVE_AMD_" + FDEFINES="$psblas_cv_define_prepend-DPSB_HAVE_AMD $FDEFINES" + CDEFINES="$psblas_cv_amd_includes $CDEFINES" + CHAVEAMD="#define PSB_HAVE_AMD" fi @@ -830,7 +830,7 @@ if test "x$pac_cv_cuda" == "xyes"; then if test "x$pac_cv_ipk_size" != "x4"; then AC_MSG_NOTICE([For CUDA I need psb_ipk_ to be 4 bytes but it is $pac_cv_ipk_size, disabling CUDA/SPGPU]) pac_cv_cuda="no"; - HAVE_CUDA="no"; + PSB_HAVE_CUDA="no"; CUDA_CC=""; SPGPU_LIBS=""; CUDAD=""; @@ -850,13 +850,13 @@ else PAC_CHECK_CUDA_VERSION() dnl PAC_CHECK_SPGPU() - HAVE_CUDA="yes"; - CUDA_VERSION="$pac_cv_cuda_version"; - CUDA_SHORT_VERSION=$(expr $pac_cv_cuda_version / 1000); - CUDA_DEFINES="-DHAVE_CUDA -DCUDA_SHORT_VERSION=${CUDA_SHORT_VERSION} -DCUDA_VERSION=${CUDA_VERSION}"; - CHAVECUDA="#define HAVE_CUDA" - CSHORTVCUDA="#define CUDA_SHORT_VERSION ${CUDA_SHORT_VERSION}" - CVERSIONCUDA="#define CUDA_VERSION ${CUDA_VERSION}" + PSB_HAVE_CUDA="yes"; + PSB_CUDA_VERSION="$pac_cv_cuda_version"; + PSB_CUDA_SHORT_VERSION=$(expr $pac_cv_cuda_version / 1000); + CUDA_DEFINES="-DPSB_HAVE_CUDA -DPSB_CUDA_SHORT_VERSION=${PSB_CUDA_SHORT_VERSION} -DPSB_CUDA_VERSION=${PSB_CUDA_VERSION}"; + CHAVECUDA="#define PSB_HAVE_CUDA" + CSHORTVCUDA="#define PSB_CUDA_SHORT_VERSION ${PSB_CUDA_SHORT_VERSION}" + CVERSIONCUDA="#define PSB_CUDA_VERSION ${PSB_CUDA_VERSION}" SPGPU_LIBS="-lspgpu"; CUDAD=cudad; CUDALD=cudald; @@ -946,7 +946,7 @@ else AC_MSG_RESULT([$LIBRSB_DIR]) RSBTARGETLIB=rsbd; RSBTARGETOBJ=rsbobj; - CHAVELIBRSB="#define HAVE_LIBRSB" + CHAVELIBRSB="#define PSB_HAVE_LIBRSB" fi @@ -1011,7 +1011,7 @@ AC_SUBST(CINCLUDES) AC_SUBST(FINCLUDES) PSBLASRULES=' -PSBLDLIBS=$(LAPACK) $(BLAS) $(METIS_LIB) $(AMD_LIB) $(FLIBS) $(LIBS) +PSBLDLIBS=$(LAPACK) $(BLAS) $(PSB_METIS_LIB) $(AMD_LIB) $(FLIBS) $(LIBS) CXXDEFINES=$(PSBCXXDEFINES) CDEFINES=$(PSBCDEFINES) FDEFINES=$(PSBFDEFINES) @@ -1028,10 +1028,10 @@ FDEFINES=$(PSBFDEFINES) $(CXX) $(CXXOPT) $(CXXINCLUDES) $(CXXDEFINES) -c $< -o $@' -AC_SUBST(IPKDEF) -AC_SUBST(LPKDEF) +AC_SUBST(PSB_IPKDEF) +AC_SUBST(PSB_LPKDEF) AC_SUBST(CSERIALMPI) -AC_SUBST(CHAVEOPENMP) +AC_SUBST(CHAVE_OPENMP) AC_SUBST(CHAVEMETIS) AC_SUBST(CINTMETIS) AC_SUBST(CREALMETIS) @@ -1067,8 +1067,8 @@ AC_SUBST(CCUDEFINES) AC_SUBST(CXXCUDEFINES) AC_SUBST(CUDA_INCLUDES) AC_SUBST(CUDA_LIBS) -AC_SUBST(CUDA_VERSION) -AC_SUBST(CUDA_SHORT_VERSION) +AC_SUBST(PSB_CUDA_VERSION) +AC_SUBST(PSB_CUDA_SHORT_VERSION) AC_SUBST(CUDA_NVCC) AC_SUBST(CUDEFINES) AC_SUBST(CUDAD) @@ -1107,7 +1107,7 @@ AC_MSG_NOTICE([ FCOPT : ${FCOPT} CCOPT : ${CCOPT} - CUDA : ${HAVE_CUDA} + CUDA : ${PSB_HAVE_CUDA} CUDA_CC : ${pac_cv_cudacc} OPENACC : ${pac_cv_openacc} diff --git a/cuda/c_cusparse_mod.F90 b/cuda/c_cusparse_mod.F90 index 07e57a55..3329f733 100644 --- a/cuda/c_cusparse_mod.F90 +++ b/cuda/c_cusparse_mod.F90 @@ -37,7 +37,7 @@ module c_cusparse_mod type(c_ptr) :: Mat = c_null_ptr end type c_Cmat -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 type, bind(c) :: c_Hmat type(c_ptr) :: Mat = c_null_ptr end type c_Hmat @@ -97,7 +97,7 @@ module c_cusparse_mod end function c_CSRGDeviceSetMatIndexBase end interface -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 interface CSRGDeviceCsrsmAnalysis function c_CSRGDeviceCsrsmAnalysis(Mat) & & bind(c,name="c_CSRGDeviceCsrsmAnalysis") result(res) @@ -193,7 +193,7 @@ module c_cusparse_mod end function c_CSRGDevice2Host end interface -#if CUDA_SHORT_VERSION <=10 +#if PSB_CUDA_SHORT_VERSION <=10 interface HYBGDeviceAlloc function c_HYBGDeviceAlloc(Mat,nr,nc,nz) & & bind(c,name="c_HYBGDeviceAlloc") result(res) diff --git a/cuda/ccusparse.h b/cuda/ccusparse.h index a5380a0a..8643211a 100644 --- a/cuda/ccusparse.h +++ b/cuda/ccusparse.h @@ -54,7 +54,7 @@ #define T_CSRGDeviceSetMatDiagType c_CSRGDeviceSetMatDiagType #define T_CSRGDeviceGetParms c_CSRGDeviceGetParms -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 #define T_CSRGDeviceSetMatType c_CSRGDeviceSetMatType #define T_CSRGDeviceSetMatIndexBase c_CSRGDeviceSetMatIndexBase #define T_CSRGDeviceCsrsmAnalysis c_CSRGDeviceCsrsmAnalysis @@ -78,7 +78,7 @@ #define cusparseThybsv_analysis cusparseChybsv_analysis #define cusparseTcsr2hyb cusparseCcsr2hyb -#elif CUDA_VERSION < 11030 +#elif PSB_CUDA_VERSION < 11030 #define T_CSRGDeviceSetMatType c_CSRGDeviceSetMatType #define T_CSRGDeviceSetMatIndexBase c_CSRGDeviceSetMatIndexBase diff --git a/cuda/d_cusparse_mod.F90 b/cuda/d_cusparse_mod.F90 index 399ac085..55751475 100644 --- a/cuda/d_cusparse_mod.F90 +++ b/cuda/d_cusparse_mod.F90 @@ -37,7 +37,7 @@ module d_cusparse_mod type(c_ptr) :: Mat = c_null_ptr end type d_Cmat -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 type, bind(c) :: d_Hmat type(c_ptr) :: Mat = c_null_ptr end type d_Hmat @@ -97,7 +97,7 @@ module d_cusparse_mod end function d_CSRGDeviceSetMatIndexBase end interface -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 interface CSRGDeviceCsrsmAnalysis function d_CSRGDeviceCsrsmAnalysis(Mat) & & bind(c,name="d_CSRGDeviceCsrsmAnalysis") result(res) @@ -193,7 +193,7 @@ module d_cusparse_mod end function d_CSRGDevice2Host end interface -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 interface HYBGDeviceAlloc function d_HYBGDeviceAlloc(Mat,nr,nc,nz) & & bind(c,name="d_HYBGDeviceAlloc") result(res) diff --git a/cuda/dcusparse.h b/cuda/dcusparse.h index 34849b1e..4b00173b 100644 --- a/cuda/dcusparse.h +++ b/cuda/dcusparse.h @@ -54,7 +54,7 @@ #define T_CSRGDeviceSetMatDiagType d_CSRGDeviceSetMatDiagType #define T_CSRGDeviceGetParms d_CSRGDeviceGetParms -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 #define T_CSRGDeviceSetMatType d_CSRGDeviceSetMatType #define T_CSRGDeviceSetMatIndexBase d_CSRGDeviceSetMatIndexBase #define T_CSRGDeviceCsrsmAnalysis d_CSRGDeviceCsrsmAnalysis @@ -78,7 +78,7 @@ #define cusparseThybsv_analysis cusparseDhybsv_analysis #define cusparseTcsr2hyb cusparseDcsr2hyb -#elif CUDA_VERSION < 11030 +#elif PSB_CUDA_VERSION < 11030 #define T_CSRGDeviceSetMatType d_CSRGDeviceSetMatType #define T_CSRGDeviceSetMatIndexBase d_CSRGDeviceSetMatIndexBase diff --git a/cuda/fcusparse.h b/cuda/fcusparse.h index 02a45fa3..73417591 100644 --- a/cuda/fcusparse.h +++ b/cuda/fcusparse.h @@ -34,7 +34,7 @@ #define FCUSPARSE_ #include -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 #include #else #include diff --git a/cuda/fcusparse_dat.h b/cuda/fcusparse_dat.h index 4b7cd6ce..09de4363 100644 --- a/cuda/fcusparse_dat.h +++ b/cuda/fcusparse_dat.h @@ -33,10 +33,10 @@ typedef struct T_CSRGDeviceMat { -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 cusparseMatDescr_t descr; cusparseSolveAnalysisInfo_t triang; -#elif CUDA_VERSION < 11030 +#elif PSB_CUDA_VERSION < 11030 cusparseMatDescr_t descr; csrsv2Info_t triang; size_t mvbsize, svbsize; @@ -59,7 +59,7 @@ typedef struct T_Cmat T_CSRGDeviceMat *mat; } T_Cmat; -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 typedef struct T_HYBGDeviceMat { cusparseMatDescr_t descr; @@ -94,13 +94,13 @@ int T_CSRGDevice2Host(T_Cmat *Mat, int m, int n, int nz, int T_CSRGDeviceGetParms(T_Cmat *Mat,int *nr, int *nc, int *nz); -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 int T_CSRGDeviceSetMatType(T_Cmat *Mat, int type); int T_CSRGDeviceSetMatFillMode(T_Cmat *Mat, int type); int T_CSRGDeviceSetMatDiagType(T_Cmat *Mat, int type); int T_CSRGDeviceSetMatIndexBase(T_Cmat *Mat, int type); int T_CSRGDeviceCsrsmAnalysis(T_Cmat *Mat); -#elif CUDA_VERSION < 11030 +#elif PSB_CUDA_VERSION < 11030 int T_CSRGDeviceSetMatType(T_Cmat *Mat, int type); int T_CSRGDeviceSetMatFillMode(T_Cmat *Mat, int type); int T_CSRGDeviceSetMatDiagType(T_Cmat *Mat, int type); @@ -115,7 +115,7 @@ int T_CSRGIsNullMvDescr(T_CSRGDeviceMat *cMat); -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 int T_HYBGDeviceFree(T_Hmat *Matrix); diff --git a/cuda/fcusparse_fct.h b/cuda/fcusparse_fct.h index 972a5e68..e8ce7934 100644 --- a/cuda/fcusparse_fct.h +++ b/cuda/fcusparse_fct.h @@ -38,7 +38,7 @@ int T_spmvCSRGDevice(T_Cmat *Matrix, TYPE alpha, void *deviceX, int r,n; cusparseHandle_t *my_handle=getHandle(); TYPE ealpha=alpha, ebeta=beta; -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 /* getAddrMultiVecDevice(deviceX, &vX); */ /* getAddrMultiVecDevice(deviceY, &vY); */ vX=x->v_; @@ -49,7 +49,7 @@ int T_spmvCSRGDevice(T_Cmat *Matrix, TYPE alpha, void *deviceX, cMat->val, cMat->irp, cMat->ja, (const TYPE *) vX, (const TYPE *) &beta, (TYPE *) vY)); -#elif CUDA_VERSION < 11030 +#elif PSB_CUDA_VERSION < 11030 size_t bfsz; vX=x->v_; vY=y->v_; @@ -139,7 +139,7 @@ int T_spsvCSRGDevice(T_Cmat *Matrix, TYPE alpha, void *deviceX, void *vX, *vY; int r,n; cusparseHandle_t *my_handle=getHandle(); -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 vX=x->v_; vY=y->v_; @@ -147,7 +147,7 @@ int T_spsvCSRGDevice(T_Cmat *Matrix, TYPE alpha, void *deviceX, cMat->m,(const TYPE *) &alpha,cMat->descr, cMat->val, cMat->irp, cMat->ja, cMat->triang, (const TYPE *) vX, (TYPE *) vY); -#elif CUDA_VERSION < 11030 +#elif PSB_CUDA_VERSION < 11030 vX=x->v_; vY=y->v_; CHECK_CUSPARSE(cusparseTcsrsv2_solve(*my_handle,CUSPARSE_OPERATION_NON_TRANSPOSE, @@ -219,7 +219,7 @@ int T_spsvCSRGDevice(T_Cmat *Matrix, TYPE alpha, void *deviceX, return(0); } -#if CUDA_VERSION >= 11030 +#if PSB_CUDA_VERSION >= 11030 int T_CSRGCreateSpMVDescr(T_CSRGDeviceMat *cMat) { int64_t tr,tc,tz; @@ -262,12 +262,12 @@ int T_CSRGDeviceAlloc(T_Cmat *Matrix,int nr, int nc, int nz) if ((rc= allocRemoteBuffer(((void **) &(cMat->val)), (((size_t) nz1)*sizeof(TYPE)))) != 0) return(rc); -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 if ((rc= cusparseCreateMatDescr(&(cMat->descr))) !=0) return(rc); if ((rc= cusparseCreateSolveAnalysisInfo(&(cMat->triang))) !=0) return(rc); -#elif CUDA_VERSION < 11030 +#elif PSB_CUDA_VERSION < 11030 if ((rc= cusparseCreateMatDescr(&(cMat->descr))) !=0) return(rc); CHECK_CUSPARSE(cusparseSetMatType(cMat->descr,CUSPARSE_MATRIX_TYPE_GENERAL)); @@ -323,10 +323,10 @@ int T_CSRGDeviceFree(T_Cmat *Matrix) freeRemoteBuffer(cMat->irp); freeRemoteBuffer(cMat->ja); freeRemoteBuffer(cMat->val); -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 cusparseDestroyMatDescr(cMat->descr); cusparseDestroySolveAnalysisInfo(cMat->triang); -#elif CUDA_VERSION < 11030 +#elif PSB_CUDA_VERSION < 11030 cusparseDestroyMatDescr(cMat->descr); cusparseDestroyCsrsv2Info(cMat->triang); #else @@ -369,7 +369,7 @@ int T_CSRGDeviceGetParms(T_Cmat *Matrix,int *nr, int *nc, int *nz) } } -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 int T_CSRGDeviceSetMatType(T_Cmat *Matrix, int type) { @@ -412,7 +412,7 @@ int T_CSRGDeviceCsrsmAnalysis(T_Cmat *Matrix) return(rc); } -#elif CUDA_VERSION < 11030 +#elif PSB_CUDA_VERSION < 11030 int T_CSRGDeviceSetMatType(T_Cmat *Matrix, int type) { T_CSRGDeviceMat *cMat= Matrix->mat; @@ -498,7 +498,7 @@ int T_CSRGHost2Device(T_Cmat *Matrix, int m, int n, int nz, ((size_t) nz)*sizeof(TYPE))) != SPGPU_SUCCESS) return(rc); -#if (CUDA_SHORT_VERSION > 10 ) && (CUDA_VERSION < 11030) +#if (PSB_CUDA_SHORT_VERSION > 10 ) && (PSB_CUDA_VERSION < 11030) if (cusparseGetMatType(cMat->descr)== CUSPARSE_MATRIX_TYPE_TRIANGULAR) { // Why do we need to set TYPE_GENERAL??? cuSPARSE can be misterious sometimes. cusparseSetMatType(cMat->descr,CUSPARSE_MATRIX_TYPE_GENERAL); @@ -537,7 +537,7 @@ int T_CSRGDevice2Host(T_Cmat *Matrix, int m, int n, int nz, return(CUSPARSE_STATUS_SUCCESS); } -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 int T_HYBGDeviceFree(T_Hmat *Matrix) { T_HYBGDeviceMat *hMat= Matrix->mat; diff --git a/cuda/impl/psb_c_cuda_cp_hybg_from_coo.F90 b/cuda/impl/psb_c_cuda_cp_hybg_from_coo.F90 index d29da0b7..d69247d0 100644 --- a/cuda/impl/psb_c_cuda_cp_hybg_from_coo.F90 +++ b/cuda/impl/psb_c_cuda_cp_hybg_from_coo.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_c_cuda_cp_hybg_from_coo(a,b,info) diff --git a/cuda/impl/psb_c_cuda_cp_hybg_from_fmt.F90 b/cuda/impl/psb_c_cuda_cp_hybg_from_fmt.F90 index 9ed53040..a6e87518 100644 --- a/cuda/impl/psb_c_cuda_cp_hybg_from_fmt.F90 +++ b/cuda/impl/psb_c_cuda_cp_hybg_from_fmt.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_c_cuda_cp_hybg_from_fmt(a,b,info) diff --git a/cuda/impl/psb_c_cuda_csrg_from_gpu.F90 b/cuda/impl/psb_c_cuda_csrg_from_gpu.F90 index 503bc57e..1b18195d 100644 --- a/cuda/impl/psb_c_cuda_csrg_from_gpu.F90 +++ b/cuda/impl/psb_c_cuda_csrg_from_gpu.F90 @@ -57,7 +57,7 @@ subroutine psb_c_cuda_csrg_from_gpu(a,info) if (info == 0) call psb_realloc(nz,a%val,info) if (info == 0) info = & & CSRGDevice2Host(a%deviceMat,m,n,nz,a%irp,a%ja,a%val) -#if (CUDA_SHORT_VERSION <= 10) || (CUDA_VERSION < 11030) +#if (PSB_CUDA_SHORT_VERSION <= 10) || (PSB_CUDA_VERSION < 11030) a%irp(:) = a%irp(:)+1 a%ja(:) = a%ja(:)+1 #endif diff --git a/cuda/impl/psb_c_cuda_csrg_to_gpu.F90 b/cuda/impl/psb_c_cuda_csrg_to_gpu.F90 index cc3fbaaf..8dac41c0 100644 --- a/cuda/impl/psb_c_cuda_csrg_to_gpu.F90 +++ b/cuda/impl/psb_c_cuda_csrg_to_gpu.F90 @@ -55,7 +55,7 @@ subroutine psb_c_cuda_csrg_to_gpu(a,info,nzrm) if (c_associated(a%deviceMat%Mat)) then info = CSRGDeviceFree(a%deviceMat) end if -#if (CUDA_SHORT_VERSION <= 10 ) +#if (PSB_CUDA_SHORT_VERSION <= 10 ) if (a%is_unit()) then ! ! CUSPARSE has the habit of storing the diagonal and then ignoring, @@ -137,7 +137,7 @@ subroutine psb_c_cuda_csrg_to_gpu(a,info,nzrm) info = CSRGDeviceCsrsmAnalysis(a%deviceMat) end if -#elif CUDA_VERSION < 11030 +#elif PSB_CUDA_VERSION < 11030 if (a%is_unit()) then ! ! CUSPARSE has the habit of storing the diagonal and then ignoring, diff --git a/cuda/impl/psb_c_cuda_dnsg_mat_impl.F90 b/cuda/impl/psb_c_cuda_dnsg_mat_impl.F90 index 7aaa37f1..65a42640 100644 --- a/cuda/impl/psb_c_cuda_dnsg_mat_impl.F90 +++ b/cuda/impl/psb_c_cuda_dnsg_mat_impl.F90 @@ -278,13 +278,9 @@ subroutine psb_c_cuda_cp_dnsg_from_fmt(a,b,info) !!$ m = b%get_nrows() !!$ nc = b%get_ncols() !!$ nza = b%get_nzeros() -!!$#ifdef HAVE_SPGPU !!$ gpu_parms = FgetEllDeviceParams(m,nzm,nza,nc,spgpu_type_double,1) !!$ ld = gpu_parms%pitch !!$ nzm = gpu_parms%maxRowSize -!!$#else -!!$ ld = m -!!$#endif !!$ a%psb_c_base_sparse_mat = b%psb_c_base_sparse_mat !!$ if (info == 0) call psb_safe_cpy( b%idiag, a%idiag , info) !!$ if (info == 0) call psb_safe_cpy( b%irn, a%irn , info) @@ -299,9 +295,7 @@ subroutine psb_c_cuda_cp_dnsg_from_fmt(a,b,info) !!$ a%val(1:m,1:nzm) = b%val(1:m,1:nzm) !!$ end if !!$ a%nzt = nza -!!$#ifdef HAVE_SPGPU !!$ call a%to_gpu(info) -!!$#endif class default @@ -385,13 +379,9 @@ subroutine psb_c_cuda_mv_dnsg_from_fmt(a,b,info) !!$ m = b%get_nrows() !!$ nc = b%get_ncols() !!$ nza = b%get_nzeros() -!!$#ifdef HAVE_SPGPU !!$ gpu_parms = FgetEllDeviceParams(m,nzm,nza,nc,spgpu_type_double,1) !!$ ld = gpu_parms%pitch !!$ nzm = gpu_parms%maxRowSize -!!$#else -!!$ ld = m -!!$#endif !!$ a%psb_c_base_sparse_mat = b%psb_c_base_sparse_mat !!$ if (info == 0) call psb_safe_cpy( b%idiag, a%idiag , info) !!$ if (info == 0) call psb_safe_cpy( b%irn, a%irn , info) @@ -406,9 +396,7 @@ subroutine psb_c_cuda_mv_dnsg_from_fmt(a,b,info) !!$ a%val(1:m,1:nzm) = b%val(1:m,1:nzm) !!$ end if !!$ a%nzt = nza -!!$#ifdef HAVE_SPGPU !!$ call a%to_gpu(info) -!!$#endif class default diff --git a/cuda/impl/psb_c_cuda_hybg_allocate_mnnz.F90 b/cuda/impl/psb_c_cuda_hybg_allocate_mnnz.F90 index bc9f3889..dbbeb1f2 100644 --- a/cuda/impl/psb_c_cuda_hybg_allocate_mnnz.F90 +++ b/cuda/impl/psb_c_cuda_hybg_allocate_mnnz.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_c_cuda_hybg_allocate_mnnz(m,n,a,nz) diff --git a/cuda/impl/psb_c_cuda_hybg_csmm.F90 b/cuda/impl/psb_c_cuda_hybg_csmm.F90 index 227b7d5c..8899f54e 100644 --- a/cuda/impl/psb_c_cuda_hybg_csmm.F90 +++ b/cuda/impl/psb_c_cuda_hybg_csmm.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_c_cuda_hybg_csmm(alpha,a,x,beta,y,info,trans) diff --git a/cuda/impl/psb_c_cuda_hybg_csmv.F90 b/cuda/impl/psb_c_cuda_hybg_csmv.F90 index e1084022..5832cf34 100644 --- a/cuda/impl/psb_c_cuda_hybg_csmv.F90 +++ b/cuda/impl/psb_c_cuda_hybg_csmv.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_c_cuda_hybg_csmv(alpha,a,x,beta,y,info,trans) diff --git a/cuda/impl/psb_c_cuda_hybg_inner_vect_sv.F90 b/cuda/impl/psb_c_cuda_hybg_inner_vect_sv.F90 index e19aafeb..4444397c 100644 --- a/cuda/impl/psb_c_cuda_hybg_inner_vect_sv.F90 +++ b/cuda/impl/psb_c_cuda_hybg_inner_vect_sv.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_c_cuda_hybg_inner_vect_sv(alpha,a,x,beta,y,info,trans) diff --git a/cuda/impl/psb_c_cuda_hybg_mold.F90 b/cuda/impl/psb_c_cuda_hybg_mold.F90 index 6fe4c378..ba0e31a0 100644 --- a/cuda/impl/psb_c_cuda_hybg_mold.F90 +++ b/cuda/impl/psb_c_cuda_hybg_mold.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_c_cuda_hybg_mold(a,b,info) diff --git a/cuda/impl/psb_c_cuda_hybg_reallocate_nz.F90 b/cuda/impl/psb_c_cuda_hybg_reallocate_nz.F90 index 15f33077..c3bd728b 100644 --- a/cuda/impl/psb_c_cuda_hybg_reallocate_nz.F90 +++ b/cuda/impl/psb_c_cuda_hybg_reallocate_nz.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_c_cuda_hybg_reallocate_nz(nz,a) diff --git a/cuda/impl/psb_c_cuda_hybg_scal.F90 b/cuda/impl/psb_c_cuda_hybg_scal.F90 index ff1c1515..d7e36019 100644 --- a/cuda/impl/psb_c_cuda_hybg_scal.F90 +++ b/cuda/impl/psb_c_cuda_hybg_scal.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_c_cuda_hybg_scal(d,a,info,side) diff --git a/cuda/impl/psb_c_cuda_hybg_scals.F90 b/cuda/impl/psb_c_cuda_hybg_scals.F90 index 1b2ddf32..03106f7a 100644 --- a/cuda/impl/psb_c_cuda_hybg_scals.F90 +++ b/cuda/impl/psb_c_cuda_hybg_scals.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_c_cuda_hybg_scals(d,a,info) diff --git a/cuda/impl/psb_c_cuda_hybg_to_gpu.F90 b/cuda/impl/psb_c_cuda_hybg_to_gpu.F90 index 15a65abc..a424c795 100644 --- a/cuda/impl/psb_c_cuda_hybg_to_gpu.F90 +++ b/cuda/impl/psb_c_cuda_hybg_to_gpu.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_c_cuda_hybg_to_gpu(a,info,nzrm) diff --git a/cuda/impl/psb_c_cuda_hybg_vect_mv.F90 b/cuda/impl/psb_c_cuda_hybg_vect_mv.F90 index 58ce0386..cb38321f 100644 --- a/cuda/impl/psb_c_cuda_hybg_vect_mv.F90 +++ b/cuda/impl/psb_c_cuda_hybg_vect_mv.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_c_cuda_hybg_vect_mv(alpha,a,x,beta,y,info,trans) diff --git a/cuda/impl/psb_c_cuda_mv_hybg_from_coo.F90 b/cuda/impl/psb_c_cuda_mv_hybg_from_coo.F90 index f7cdae40..72837aa6 100644 --- a/cuda/impl/psb_c_cuda_mv_hybg_from_coo.F90 +++ b/cuda/impl/psb_c_cuda_mv_hybg_from_coo.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_c_cuda_mv_hybg_from_coo(a,b,info) diff --git a/cuda/impl/psb_c_cuda_mv_hybg_from_fmt.F90 b/cuda/impl/psb_c_cuda_mv_hybg_from_fmt.F90 index 9be9f0b4..da910175 100644 --- a/cuda/impl/psb_c_cuda_mv_hybg_from_fmt.F90 +++ b/cuda/impl/psb_c_cuda_mv_hybg_from_fmt.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_c_cuda_mv_hybg_from_fmt(a,b,info) diff --git a/cuda/impl/psb_d_cuda_cp_hybg_from_coo.F90 b/cuda/impl/psb_d_cuda_cp_hybg_from_coo.F90 index b236a91d..6405c61d 100644 --- a/cuda/impl/psb_d_cuda_cp_hybg_from_coo.F90 +++ b/cuda/impl/psb_d_cuda_cp_hybg_from_coo.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_d_cuda_cp_hybg_from_coo(a,b,info) diff --git a/cuda/impl/psb_d_cuda_cp_hybg_from_fmt.F90 b/cuda/impl/psb_d_cuda_cp_hybg_from_fmt.F90 index 87d25252..a6f9391b 100644 --- a/cuda/impl/psb_d_cuda_cp_hybg_from_fmt.F90 +++ b/cuda/impl/psb_d_cuda_cp_hybg_from_fmt.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_d_cuda_cp_hybg_from_fmt(a,b,info) diff --git a/cuda/impl/psb_d_cuda_csrg_from_gpu.F90 b/cuda/impl/psb_d_cuda_csrg_from_gpu.F90 index 9d1c2285..9b5c4e4c 100644 --- a/cuda/impl/psb_d_cuda_csrg_from_gpu.F90 +++ b/cuda/impl/psb_d_cuda_csrg_from_gpu.F90 @@ -57,7 +57,7 @@ subroutine psb_d_cuda_csrg_from_gpu(a,info) if (info == 0) call psb_realloc(nz,a%val,info) if (info == 0) info = & & CSRGDevice2Host(a%deviceMat,m,n,nz,a%irp,a%ja,a%val) -#if (CUDA_SHORT_VERSION <= 10) || (CUDA_VERSION < 11030) +#if (PSB_CUDA_SHORT_VERSION <= 10) || (PSB_CUDA_VERSION < 11030) a%irp(:) = a%irp(:)+1 a%ja(:) = a%ja(:)+1 #endif diff --git a/cuda/impl/psb_d_cuda_csrg_to_gpu.F90 b/cuda/impl/psb_d_cuda_csrg_to_gpu.F90 index d7a1b1e7..b4067e88 100644 --- a/cuda/impl/psb_d_cuda_csrg_to_gpu.F90 +++ b/cuda/impl/psb_d_cuda_csrg_to_gpu.F90 @@ -55,7 +55,7 @@ subroutine psb_d_cuda_csrg_to_gpu(a,info,nzrm) if (c_associated(a%deviceMat%Mat)) then info = CSRGDeviceFree(a%deviceMat) end if -#if (CUDA_SHORT_VERSION <= 10 ) +#if (PSB_CUDA_SHORT_VERSION <= 10 ) if (a%is_unit()) then ! ! CUSPARSE has the habit of storing the diagonal and then ignoring, @@ -137,7 +137,7 @@ subroutine psb_d_cuda_csrg_to_gpu(a,info,nzrm) info = CSRGDeviceCsrsmAnalysis(a%deviceMat) end if -#elif CUDA_VERSION < 11030 +#elif PSB_CUDA_VERSION < 11030 if (a%is_unit()) then ! ! CUSPARSE has the habit of storing the diagonal and then ignoring, diff --git a/cuda/impl/psb_d_cuda_dnsg_mat_impl.F90 b/cuda/impl/psb_d_cuda_dnsg_mat_impl.F90 index e90e816a..e4419d81 100644 --- a/cuda/impl/psb_d_cuda_dnsg_mat_impl.F90 +++ b/cuda/impl/psb_d_cuda_dnsg_mat_impl.F90 @@ -278,13 +278,9 @@ subroutine psb_d_cuda_cp_dnsg_from_fmt(a,b,info) !!$ m = b%get_nrows() !!$ nc = b%get_ncols() !!$ nza = b%get_nzeros() -!!$#ifdef HAVE_SPGPU !!$ gpu_parms = FgetEllDeviceParams(m,nzm,nza,nc,spgpu_type_double,1) !!$ ld = gpu_parms%pitch !!$ nzm = gpu_parms%maxRowSize -!!$#else -!!$ ld = m -!!$#endif !!$ a%psb_d_base_sparse_mat = b%psb_d_base_sparse_mat !!$ if (info == 0) call psb_safe_cpy( b%idiag, a%idiag , info) !!$ if (info == 0) call psb_safe_cpy( b%irn, a%irn , info) @@ -299,9 +295,7 @@ subroutine psb_d_cuda_cp_dnsg_from_fmt(a,b,info) !!$ a%val(1:m,1:nzm) = b%val(1:m,1:nzm) !!$ end if !!$ a%nzt = nza -!!$#ifdef HAVE_SPGPU !!$ call a%to_gpu(info) -!!$#endif class default @@ -385,13 +379,9 @@ subroutine psb_d_cuda_mv_dnsg_from_fmt(a,b,info) !!$ m = b%get_nrows() !!$ nc = b%get_ncols() !!$ nza = b%get_nzeros() -!!$#ifdef HAVE_SPGPU !!$ gpu_parms = FgetEllDeviceParams(m,nzm,nza,nc,spgpu_type_double,1) !!$ ld = gpu_parms%pitch !!$ nzm = gpu_parms%maxRowSize -!!$#else -!!$ ld = m -!!$#endif !!$ a%psb_d_base_sparse_mat = b%psb_d_base_sparse_mat !!$ if (info == 0) call psb_safe_cpy( b%idiag, a%idiag , info) !!$ if (info == 0) call psb_safe_cpy( b%irn, a%irn , info) @@ -406,9 +396,7 @@ subroutine psb_d_cuda_mv_dnsg_from_fmt(a,b,info) !!$ a%val(1:m,1:nzm) = b%val(1:m,1:nzm) !!$ end if !!$ a%nzt = nza -!!$#ifdef HAVE_SPGPU !!$ call a%to_gpu(info) -!!$#endif class default diff --git a/cuda/impl/psb_d_cuda_hybg_allocate_mnnz.F90 b/cuda/impl/psb_d_cuda_hybg_allocate_mnnz.F90 index 50bef667..b9c5d3d0 100644 --- a/cuda/impl/psb_d_cuda_hybg_allocate_mnnz.F90 +++ b/cuda/impl/psb_d_cuda_hybg_allocate_mnnz.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_d_cuda_hybg_allocate_mnnz(m,n,a,nz) diff --git a/cuda/impl/psb_d_cuda_hybg_csmm.F90 b/cuda/impl/psb_d_cuda_hybg_csmm.F90 index d5b49829..dbf33990 100644 --- a/cuda/impl/psb_d_cuda_hybg_csmm.F90 +++ b/cuda/impl/psb_d_cuda_hybg_csmm.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_d_cuda_hybg_csmm(alpha,a,x,beta,y,info,trans) diff --git a/cuda/impl/psb_d_cuda_hybg_csmv.F90 b/cuda/impl/psb_d_cuda_hybg_csmv.F90 index b29b889a..1565c648 100644 --- a/cuda/impl/psb_d_cuda_hybg_csmv.F90 +++ b/cuda/impl/psb_d_cuda_hybg_csmv.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_d_cuda_hybg_csmv(alpha,a,x,beta,y,info,trans) diff --git a/cuda/impl/psb_d_cuda_hybg_inner_vect_sv.F90 b/cuda/impl/psb_d_cuda_hybg_inner_vect_sv.F90 index 6f5eba3b..902f871d 100644 --- a/cuda/impl/psb_d_cuda_hybg_inner_vect_sv.F90 +++ b/cuda/impl/psb_d_cuda_hybg_inner_vect_sv.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_d_cuda_hybg_inner_vect_sv(alpha,a,x,beta,y,info,trans) diff --git a/cuda/impl/psb_d_cuda_hybg_mold.F90 b/cuda/impl/psb_d_cuda_hybg_mold.F90 index fa239696..3e51acf6 100644 --- a/cuda/impl/psb_d_cuda_hybg_mold.F90 +++ b/cuda/impl/psb_d_cuda_hybg_mold.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_d_cuda_hybg_mold(a,b,info) diff --git a/cuda/impl/psb_d_cuda_hybg_reallocate_nz.F90 b/cuda/impl/psb_d_cuda_hybg_reallocate_nz.F90 index f44c3f10..e9699e77 100644 --- a/cuda/impl/psb_d_cuda_hybg_reallocate_nz.F90 +++ b/cuda/impl/psb_d_cuda_hybg_reallocate_nz.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_d_cuda_hybg_reallocate_nz(nz,a) diff --git a/cuda/impl/psb_d_cuda_hybg_scal.F90 b/cuda/impl/psb_d_cuda_hybg_scal.F90 index 5be8d801..15a33d7b 100644 --- a/cuda/impl/psb_d_cuda_hybg_scal.F90 +++ b/cuda/impl/psb_d_cuda_hybg_scal.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_d_cuda_hybg_scal(d,a,info,side) diff --git a/cuda/impl/psb_d_cuda_hybg_scals.F90 b/cuda/impl/psb_d_cuda_hybg_scals.F90 index 59e21dd2..34faa15d 100644 --- a/cuda/impl/psb_d_cuda_hybg_scals.F90 +++ b/cuda/impl/psb_d_cuda_hybg_scals.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_d_cuda_hybg_scals(d,a,info) diff --git a/cuda/impl/psb_d_cuda_hybg_to_gpu.F90 b/cuda/impl/psb_d_cuda_hybg_to_gpu.F90 index 7b8e2e5f..ba859622 100644 --- a/cuda/impl/psb_d_cuda_hybg_to_gpu.F90 +++ b/cuda/impl/psb_d_cuda_hybg_to_gpu.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_d_cuda_hybg_to_gpu(a,info,nzrm) diff --git a/cuda/impl/psb_d_cuda_hybg_vect_mv.F90 b/cuda/impl/psb_d_cuda_hybg_vect_mv.F90 index f1119439..49060c3c 100644 --- a/cuda/impl/psb_d_cuda_hybg_vect_mv.F90 +++ b/cuda/impl/psb_d_cuda_hybg_vect_mv.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_d_cuda_hybg_vect_mv(alpha,a,x,beta,y,info,trans) diff --git a/cuda/impl/psb_d_cuda_mv_hybg_from_coo.F90 b/cuda/impl/psb_d_cuda_mv_hybg_from_coo.F90 index 3113fb13..42f3aca3 100644 --- a/cuda/impl/psb_d_cuda_mv_hybg_from_coo.F90 +++ b/cuda/impl/psb_d_cuda_mv_hybg_from_coo.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_d_cuda_mv_hybg_from_coo(a,b,info) diff --git a/cuda/impl/psb_d_cuda_mv_hybg_from_fmt.F90 b/cuda/impl/psb_d_cuda_mv_hybg_from_fmt.F90 index 520792e9..f9c34f35 100644 --- a/cuda/impl/psb_d_cuda_mv_hybg_from_fmt.F90 +++ b/cuda/impl/psb_d_cuda_mv_hybg_from_fmt.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_d_cuda_mv_hybg_from_fmt(a,b,info) diff --git a/cuda/impl/psb_s_cuda_cp_hybg_from_coo.F90 b/cuda/impl/psb_s_cuda_cp_hybg_from_coo.F90 index 69aa615b..bf33a7a4 100644 --- a/cuda/impl/psb_s_cuda_cp_hybg_from_coo.F90 +++ b/cuda/impl/psb_s_cuda_cp_hybg_from_coo.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_s_cuda_cp_hybg_from_coo(a,b,info) diff --git a/cuda/impl/psb_s_cuda_cp_hybg_from_fmt.F90 b/cuda/impl/psb_s_cuda_cp_hybg_from_fmt.F90 index 95e00df1..2f22252d 100644 --- a/cuda/impl/psb_s_cuda_cp_hybg_from_fmt.F90 +++ b/cuda/impl/psb_s_cuda_cp_hybg_from_fmt.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_s_cuda_cp_hybg_from_fmt(a,b,info) diff --git a/cuda/impl/psb_s_cuda_csrg_from_gpu.F90 b/cuda/impl/psb_s_cuda_csrg_from_gpu.F90 index adcb2536..da1a7184 100644 --- a/cuda/impl/psb_s_cuda_csrg_from_gpu.F90 +++ b/cuda/impl/psb_s_cuda_csrg_from_gpu.F90 @@ -57,7 +57,7 @@ subroutine psb_s_cuda_csrg_from_gpu(a,info) if (info == 0) call psb_realloc(nz,a%val,info) if (info == 0) info = & & CSRGDevice2Host(a%deviceMat,m,n,nz,a%irp,a%ja,a%val) -#if (CUDA_SHORT_VERSION <= 10) || (CUDA_VERSION < 11030) +#if (PSB_CUDA_SHORT_VERSION <= 10) || (PSB_CUDA_VERSION < 11030) a%irp(:) = a%irp(:)+1 a%ja(:) = a%ja(:)+1 #endif diff --git a/cuda/impl/psb_s_cuda_csrg_to_gpu.F90 b/cuda/impl/psb_s_cuda_csrg_to_gpu.F90 index cc5b9c8d..0c918dd4 100644 --- a/cuda/impl/psb_s_cuda_csrg_to_gpu.F90 +++ b/cuda/impl/psb_s_cuda_csrg_to_gpu.F90 @@ -55,7 +55,7 @@ subroutine psb_s_cuda_csrg_to_gpu(a,info,nzrm) if (c_associated(a%deviceMat%Mat)) then info = CSRGDeviceFree(a%deviceMat) end if -#if (CUDA_SHORT_VERSION <= 10 ) +#if (PSB_CUDA_SHORT_VERSION <= 10 ) if (a%is_unit()) then ! ! CUSPARSE has the habit of storing the diagonal and then ignoring, @@ -137,7 +137,7 @@ subroutine psb_s_cuda_csrg_to_gpu(a,info,nzrm) info = CSRGDeviceCsrsmAnalysis(a%deviceMat) end if -#elif CUDA_VERSION < 11030 +#elif PSB_CUDA_VERSION < 11030 if (a%is_unit()) then ! ! CUSPARSE has the habit of storing the diagonal and then ignoring, diff --git a/cuda/impl/psb_s_cuda_dnsg_mat_impl.F90 b/cuda/impl/psb_s_cuda_dnsg_mat_impl.F90 index 86fec6a7..3f12b293 100644 --- a/cuda/impl/psb_s_cuda_dnsg_mat_impl.F90 +++ b/cuda/impl/psb_s_cuda_dnsg_mat_impl.F90 @@ -278,13 +278,9 @@ subroutine psb_s_cuda_cp_dnsg_from_fmt(a,b,info) !!$ m = b%get_nrows() !!$ nc = b%get_ncols() !!$ nza = b%get_nzeros() -!!$#ifdef HAVE_SPGPU !!$ gpu_parms = FgetEllDeviceParams(m,nzm,nza,nc,spgpu_type_double,1) !!$ ld = gpu_parms%pitch !!$ nzm = gpu_parms%maxRowSize -!!$#else -!!$ ld = m -!!$#endif !!$ a%psb_s_base_sparse_mat = b%psb_s_base_sparse_mat !!$ if (info == 0) call psb_safe_cpy( b%idiag, a%idiag , info) !!$ if (info == 0) call psb_safe_cpy( b%irn, a%irn , info) @@ -299,9 +295,7 @@ subroutine psb_s_cuda_cp_dnsg_from_fmt(a,b,info) !!$ a%val(1:m,1:nzm) = b%val(1:m,1:nzm) !!$ end if !!$ a%nzt = nza -!!$#ifdef HAVE_SPGPU !!$ call a%to_gpu(info) -!!$#endif class default @@ -385,13 +379,9 @@ subroutine psb_s_cuda_mv_dnsg_from_fmt(a,b,info) !!$ m = b%get_nrows() !!$ nc = b%get_ncols() !!$ nza = b%get_nzeros() -!!$#ifdef HAVE_SPGPU !!$ gpu_parms = FgetEllDeviceParams(m,nzm,nza,nc,spgpu_type_double,1) !!$ ld = gpu_parms%pitch !!$ nzm = gpu_parms%maxRowSize -!!$#else -!!$ ld = m -!!$#endif !!$ a%psb_s_base_sparse_mat = b%psb_s_base_sparse_mat !!$ if (info == 0) call psb_safe_cpy( b%idiag, a%idiag , info) !!$ if (info == 0) call psb_safe_cpy( b%irn, a%irn , info) @@ -406,9 +396,7 @@ subroutine psb_s_cuda_mv_dnsg_from_fmt(a,b,info) !!$ a%val(1:m,1:nzm) = b%val(1:m,1:nzm) !!$ end if !!$ a%nzt = nza -!!$#ifdef HAVE_SPGPU !!$ call a%to_gpu(info) -!!$#endif class default diff --git a/cuda/impl/psb_s_cuda_hybg_allocate_mnnz.F90 b/cuda/impl/psb_s_cuda_hybg_allocate_mnnz.F90 index d4649d4c..a8e31ad8 100644 --- a/cuda/impl/psb_s_cuda_hybg_allocate_mnnz.F90 +++ b/cuda/impl/psb_s_cuda_hybg_allocate_mnnz.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_s_cuda_hybg_allocate_mnnz(m,n,a,nz) diff --git a/cuda/impl/psb_s_cuda_hybg_csmm.F90 b/cuda/impl/psb_s_cuda_hybg_csmm.F90 index f321ce8b..85250fe3 100644 --- a/cuda/impl/psb_s_cuda_hybg_csmm.F90 +++ b/cuda/impl/psb_s_cuda_hybg_csmm.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_s_cuda_hybg_csmm(alpha,a,x,beta,y,info,trans) diff --git a/cuda/impl/psb_s_cuda_hybg_csmv.F90 b/cuda/impl/psb_s_cuda_hybg_csmv.F90 index 5f1a8c90..993195f1 100644 --- a/cuda/impl/psb_s_cuda_hybg_csmv.F90 +++ b/cuda/impl/psb_s_cuda_hybg_csmv.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_s_cuda_hybg_csmv(alpha,a,x,beta,y,info,trans) diff --git a/cuda/impl/psb_s_cuda_hybg_inner_vect_sv.F90 b/cuda/impl/psb_s_cuda_hybg_inner_vect_sv.F90 index 722505ff..6a230f82 100644 --- a/cuda/impl/psb_s_cuda_hybg_inner_vect_sv.F90 +++ b/cuda/impl/psb_s_cuda_hybg_inner_vect_sv.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_s_cuda_hybg_inner_vect_sv(alpha,a,x,beta,y,info,trans) diff --git a/cuda/impl/psb_s_cuda_hybg_mold.F90 b/cuda/impl/psb_s_cuda_hybg_mold.F90 index 4a1fc64e..d1b41c2b 100644 --- a/cuda/impl/psb_s_cuda_hybg_mold.F90 +++ b/cuda/impl/psb_s_cuda_hybg_mold.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_s_cuda_hybg_mold(a,b,info) diff --git a/cuda/impl/psb_s_cuda_hybg_reallocate_nz.F90 b/cuda/impl/psb_s_cuda_hybg_reallocate_nz.F90 index 7311ed64..d43da4d9 100644 --- a/cuda/impl/psb_s_cuda_hybg_reallocate_nz.F90 +++ b/cuda/impl/psb_s_cuda_hybg_reallocate_nz.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_s_cuda_hybg_reallocate_nz(nz,a) diff --git a/cuda/impl/psb_s_cuda_hybg_scal.F90 b/cuda/impl/psb_s_cuda_hybg_scal.F90 index d6f8eb8d..b1e24426 100644 --- a/cuda/impl/psb_s_cuda_hybg_scal.F90 +++ b/cuda/impl/psb_s_cuda_hybg_scal.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_s_cuda_hybg_scal(d,a,info,side) diff --git a/cuda/impl/psb_s_cuda_hybg_scals.F90 b/cuda/impl/psb_s_cuda_hybg_scals.F90 index f80d8efe..93c74756 100644 --- a/cuda/impl/psb_s_cuda_hybg_scals.F90 +++ b/cuda/impl/psb_s_cuda_hybg_scals.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_s_cuda_hybg_scals(d,a,info) diff --git a/cuda/impl/psb_s_cuda_hybg_to_gpu.F90 b/cuda/impl/psb_s_cuda_hybg_to_gpu.F90 index 168a0981..3f85a5c6 100644 --- a/cuda/impl/psb_s_cuda_hybg_to_gpu.F90 +++ b/cuda/impl/psb_s_cuda_hybg_to_gpu.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_s_cuda_hybg_to_gpu(a,info,nzrm) diff --git a/cuda/impl/psb_s_cuda_hybg_vect_mv.F90 b/cuda/impl/psb_s_cuda_hybg_vect_mv.F90 index 6273f31a..e786afe1 100644 --- a/cuda/impl/psb_s_cuda_hybg_vect_mv.F90 +++ b/cuda/impl/psb_s_cuda_hybg_vect_mv.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_s_cuda_hybg_vect_mv(alpha,a,x,beta,y,info,trans) diff --git a/cuda/impl/psb_s_cuda_mv_hybg_from_coo.F90 b/cuda/impl/psb_s_cuda_mv_hybg_from_coo.F90 index ddae4546..a22741fc 100644 --- a/cuda/impl/psb_s_cuda_mv_hybg_from_coo.F90 +++ b/cuda/impl/psb_s_cuda_mv_hybg_from_coo.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_s_cuda_mv_hybg_from_coo(a,b,info) diff --git a/cuda/impl/psb_s_cuda_mv_hybg_from_fmt.F90 b/cuda/impl/psb_s_cuda_mv_hybg_from_fmt.F90 index c6250104..53865e65 100644 --- a/cuda/impl/psb_s_cuda_mv_hybg_from_fmt.F90 +++ b/cuda/impl/psb_s_cuda_mv_hybg_from_fmt.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_s_cuda_mv_hybg_from_fmt(a,b,info) diff --git a/cuda/impl/psb_z_cuda_cp_hybg_from_coo.F90 b/cuda/impl/psb_z_cuda_cp_hybg_from_coo.F90 index a6491d68..f49742cd 100644 --- a/cuda/impl/psb_z_cuda_cp_hybg_from_coo.F90 +++ b/cuda/impl/psb_z_cuda_cp_hybg_from_coo.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_z_cuda_cp_hybg_from_coo(a,b,info) diff --git a/cuda/impl/psb_z_cuda_cp_hybg_from_fmt.F90 b/cuda/impl/psb_z_cuda_cp_hybg_from_fmt.F90 index 748fadca..bc59cdba 100644 --- a/cuda/impl/psb_z_cuda_cp_hybg_from_fmt.F90 +++ b/cuda/impl/psb_z_cuda_cp_hybg_from_fmt.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_z_cuda_cp_hybg_from_fmt(a,b,info) diff --git a/cuda/impl/psb_z_cuda_csrg_from_gpu.F90 b/cuda/impl/psb_z_cuda_csrg_from_gpu.F90 index 78db4435..202f9f75 100644 --- a/cuda/impl/psb_z_cuda_csrg_from_gpu.F90 +++ b/cuda/impl/psb_z_cuda_csrg_from_gpu.F90 @@ -57,7 +57,7 @@ subroutine psb_z_cuda_csrg_from_gpu(a,info) if (info == 0) call psb_realloc(nz,a%val,info) if (info == 0) info = & & CSRGDevice2Host(a%deviceMat,m,n,nz,a%irp,a%ja,a%val) -#if (CUDA_SHORT_VERSION <= 10) || (CUDA_VERSION < 11030) +#if (PSB_CUDA_SHORT_VERSION <= 10) || (PSB_CUDA_VERSION < 11030) a%irp(:) = a%irp(:)+1 a%ja(:) = a%ja(:)+1 #endif diff --git a/cuda/impl/psb_z_cuda_csrg_to_gpu.F90 b/cuda/impl/psb_z_cuda_csrg_to_gpu.F90 index 56943f37..154c91f8 100644 --- a/cuda/impl/psb_z_cuda_csrg_to_gpu.F90 +++ b/cuda/impl/psb_z_cuda_csrg_to_gpu.F90 @@ -55,7 +55,7 @@ subroutine psb_z_cuda_csrg_to_gpu(a,info,nzrm) if (c_associated(a%deviceMat%Mat)) then info = CSRGDeviceFree(a%deviceMat) end if -#if (CUDA_SHORT_VERSION <= 10 ) +#if (PSB_CUDA_SHORT_VERSION <= 10 ) if (a%is_unit()) then ! ! CUSPARSE has the habit of storing the diagonal and then ignoring, @@ -137,7 +137,7 @@ subroutine psb_z_cuda_csrg_to_gpu(a,info,nzrm) info = CSRGDeviceCsrsmAnalysis(a%deviceMat) end if -#elif CUDA_VERSION < 11030 +#elif PSB_CUDA_VERSION < 11030 if (a%is_unit()) then ! ! CUSPARSE has the habit of storing the diagonal and then ignoring, diff --git a/cuda/impl/psb_z_cuda_dnsg_mat_impl.F90 b/cuda/impl/psb_z_cuda_dnsg_mat_impl.F90 index c79a7e8c..7f41b22d 100644 --- a/cuda/impl/psb_z_cuda_dnsg_mat_impl.F90 +++ b/cuda/impl/psb_z_cuda_dnsg_mat_impl.F90 @@ -278,13 +278,9 @@ subroutine psb_z_cuda_cp_dnsg_from_fmt(a,b,info) !!$ m = b%get_nrows() !!$ nc = b%get_ncols() !!$ nza = b%get_nzeros() -!!$#ifdef HAVE_SPGPU !!$ gpu_parms = FgetEllDeviceParams(m,nzm,nza,nc,spgpu_type_double,1) !!$ ld = gpu_parms%pitch !!$ nzm = gpu_parms%maxRowSize -!!$#else -!!$ ld = m -!!$#endif !!$ a%psb_z_base_sparse_mat = b%psb_z_base_sparse_mat !!$ if (info == 0) call psb_safe_cpy( b%idiag, a%idiag , info) !!$ if (info == 0) call psb_safe_cpy( b%irn, a%irn , info) @@ -299,9 +295,7 @@ subroutine psb_z_cuda_cp_dnsg_from_fmt(a,b,info) !!$ a%val(1:m,1:nzm) = b%val(1:m,1:nzm) !!$ end if !!$ a%nzt = nza -!!$#ifdef HAVE_SPGPU !!$ call a%to_gpu(info) -!!$#endif class default @@ -385,13 +379,9 @@ subroutine psb_z_cuda_mv_dnsg_from_fmt(a,b,info) !!$ m = b%get_nrows() !!$ nc = b%get_ncols() !!$ nza = b%get_nzeros() -!!$#ifdef HAVE_SPGPU !!$ gpu_parms = FgetEllDeviceParams(m,nzm,nza,nc,spgpu_type_double,1) !!$ ld = gpu_parms%pitch !!$ nzm = gpu_parms%maxRowSize -!!$#else -!!$ ld = m -!!$#endif !!$ a%psb_z_base_sparse_mat = b%psb_z_base_sparse_mat !!$ if (info == 0) call psb_safe_cpy( b%idiag, a%idiag , info) !!$ if (info == 0) call psb_safe_cpy( b%irn, a%irn , info) @@ -406,9 +396,7 @@ subroutine psb_z_cuda_mv_dnsg_from_fmt(a,b,info) !!$ a%val(1:m,1:nzm) = b%val(1:m,1:nzm) !!$ end if !!$ a%nzt = nza -!!$#ifdef HAVE_SPGPU !!$ call a%to_gpu(info) -!!$#endif class default diff --git a/cuda/impl/psb_z_cuda_hybg_allocate_mnnz.F90 b/cuda/impl/psb_z_cuda_hybg_allocate_mnnz.F90 index 39e10134..dbfbfb91 100644 --- a/cuda/impl/psb_z_cuda_hybg_allocate_mnnz.F90 +++ b/cuda/impl/psb_z_cuda_hybg_allocate_mnnz.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_z_cuda_hybg_allocate_mnnz(m,n,a,nz) diff --git a/cuda/impl/psb_z_cuda_hybg_csmm.F90 b/cuda/impl/psb_z_cuda_hybg_csmm.F90 index bcd1874a..3c53acbd 100644 --- a/cuda/impl/psb_z_cuda_hybg_csmm.F90 +++ b/cuda/impl/psb_z_cuda_hybg_csmm.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_z_cuda_hybg_csmm(alpha,a,x,beta,y,info,trans) diff --git a/cuda/impl/psb_z_cuda_hybg_csmv.F90 b/cuda/impl/psb_z_cuda_hybg_csmv.F90 index d7c5cab6..17b35b40 100644 --- a/cuda/impl/psb_z_cuda_hybg_csmv.F90 +++ b/cuda/impl/psb_z_cuda_hybg_csmv.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_z_cuda_hybg_csmv(alpha,a,x,beta,y,info,trans) diff --git a/cuda/impl/psb_z_cuda_hybg_inner_vect_sv.F90 b/cuda/impl/psb_z_cuda_hybg_inner_vect_sv.F90 index 36fa3890..9b06d499 100644 --- a/cuda/impl/psb_z_cuda_hybg_inner_vect_sv.F90 +++ b/cuda/impl/psb_z_cuda_hybg_inner_vect_sv.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_z_cuda_hybg_inner_vect_sv(alpha,a,x,beta,y,info,trans) diff --git a/cuda/impl/psb_z_cuda_hybg_mold.F90 b/cuda/impl/psb_z_cuda_hybg_mold.F90 index 5a13ff19..236c8359 100644 --- a/cuda/impl/psb_z_cuda_hybg_mold.F90 +++ b/cuda/impl/psb_z_cuda_hybg_mold.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_z_cuda_hybg_mold(a,b,info) diff --git a/cuda/impl/psb_z_cuda_hybg_reallocate_nz.F90 b/cuda/impl/psb_z_cuda_hybg_reallocate_nz.F90 index f295b332..2479226c 100644 --- a/cuda/impl/psb_z_cuda_hybg_reallocate_nz.F90 +++ b/cuda/impl/psb_z_cuda_hybg_reallocate_nz.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_z_cuda_hybg_reallocate_nz(nz,a) diff --git a/cuda/impl/psb_z_cuda_hybg_scal.F90 b/cuda/impl/psb_z_cuda_hybg_scal.F90 index 40b9d6b0..c365499f 100644 --- a/cuda/impl/psb_z_cuda_hybg_scal.F90 +++ b/cuda/impl/psb_z_cuda_hybg_scal.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_z_cuda_hybg_scal(d,a,info,side) diff --git a/cuda/impl/psb_z_cuda_hybg_scals.F90 b/cuda/impl/psb_z_cuda_hybg_scals.F90 index bd7b9224..95bb1273 100644 --- a/cuda/impl/psb_z_cuda_hybg_scals.F90 +++ b/cuda/impl/psb_z_cuda_hybg_scals.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_z_cuda_hybg_scals(d,a,info) diff --git a/cuda/impl/psb_z_cuda_hybg_to_gpu.F90 b/cuda/impl/psb_z_cuda_hybg_to_gpu.F90 index f3a32c81..b75f9df7 100644 --- a/cuda/impl/psb_z_cuda_hybg_to_gpu.F90 +++ b/cuda/impl/psb_z_cuda_hybg_to_gpu.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_z_cuda_hybg_to_gpu(a,info,nzrm) diff --git a/cuda/impl/psb_z_cuda_hybg_vect_mv.F90 b/cuda/impl/psb_z_cuda_hybg_vect_mv.F90 index 0cb1db22..a5c082de 100644 --- a/cuda/impl/psb_z_cuda_hybg_vect_mv.F90 +++ b/cuda/impl/psb_z_cuda_hybg_vect_mv.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_z_cuda_hybg_vect_mv(alpha,a,x,beta,y,info,trans) diff --git a/cuda/impl/psb_z_cuda_mv_hybg_from_coo.F90 b/cuda/impl/psb_z_cuda_mv_hybg_from_coo.F90 index 69fda3d6..dbf0e512 100644 --- a/cuda/impl/psb_z_cuda_mv_hybg_from_coo.F90 +++ b/cuda/impl/psb_z_cuda_mv_hybg_from_coo.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_z_cuda_mv_hybg_from_coo(a,b,info) diff --git a/cuda/impl/psb_z_cuda_mv_hybg_from_fmt.F90 b/cuda/impl/psb_z_cuda_mv_hybg_from_fmt.F90 index 55c33a09..d39da291 100644 --- a/cuda/impl/psb_z_cuda_mv_hybg_from_fmt.F90 +++ b/cuda/impl/psb_z_cuda_mv_hybg_from_fmt.F90 @@ -28,7 +28,7 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 subroutine psb_z_cuda_mv_hybg_from_fmt(a,b,info) diff --git a/cuda/psb_c_cuda_diag_mat_mod.F90 b/cuda/psb_c_cuda_diag_mat_mod.F90 index 93ffe498..d3232965 100644 --- a/cuda/psb_c_cuda_diag_mat_mod.F90 +++ b/cuda/psb_c_cuda_diag_mat_mod.F90 @@ -41,8 +41,6 @@ module psb_c_cuda_diag_mat_mod ! ITPACK/HLL format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of HLL, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr diff --git a/cuda/psb_c_cuda_dnsg_mat_mod.F90 b/cuda/psb_c_cuda_dnsg_mat_mod.F90 index b0ca8c46..97bacb7d 100644 --- a/cuda/psb_c_cuda_dnsg_mat_mod.F90 +++ b/cuda/psb_c_cuda_dnsg_mat_mod.F90 @@ -42,8 +42,6 @@ module psb_c_cuda_dnsg_mat_mod ! ITPACK/DNS format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of DNS, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr diff --git a/cuda/psb_c_cuda_elg_mat_mod.F90 b/cuda/psb_c_cuda_elg_mat_mod.F90 index c9b48005..c507a6c7 100644 --- a/cuda/psb_c_cuda_elg_mat_mod.F90 +++ b/cuda/psb_c_cuda_elg_mat_mod.F90 @@ -46,8 +46,6 @@ module psb_c_cuda_elg_mat_mod ! ITPACK/ELL format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of ELL, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr integer(psb_ipk_) :: devstate = is_host diff --git a/cuda/psb_c_cuda_hlg_mat_mod.F90 b/cuda/psb_c_cuda_hlg_mat_mod.F90 index e98f2474..5b80d3f6 100644 --- a/cuda/psb_c_cuda_hlg_mat_mod.F90 +++ b/cuda/psb_c_cuda_hlg_mat_mod.F90 @@ -46,8 +46,6 @@ module psb_c_cuda_hlg_mat_mod ! ITPACK/HLL format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of HLL, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr integer :: devstate = is_host diff --git a/cuda/psb_c_cuda_hybg_mat_mod.F90 b/cuda/psb_c_cuda_hybg_mat_mod.F90 index 1c94bc0f..89ec14a5 100644 --- a/cuda/psb_c_cuda_hybg_mat_mod.F90 +++ b/cuda/psb_c_cuda_hybg_mat_mod.F90 @@ -29,7 +29,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 module psb_c_cuda_hybg_mat_mod diff --git a/cuda/psb_cuda_env_mod.F90 b/cuda/psb_cuda_env_mod.F90 index 4778d229..d1cee398 100644 --- a/cuda/psb_cuda_env_mod.F90 +++ b/cuda/psb_cuda_env_mod.F90 @@ -207,7 +207,7 @@ Contains info = psb_success_ call psb_erractionsave(err_act) -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) iam = 0 #else call psb_info(ctxt,iam,np) diff --git a/cuda/psb_cuda_mod.F90 b/cuda/psb_cuda_mod.F90 index 81ce3e31..12b91b90 100644 --- a/cuda/psb_cuda_mod.F90 +++ b/cuda/psb_cuda_mod.F90 @@ -68,7 +68,7 @@ module psb_cuda_mod use psb_d_cuda_csrg_mat_mod use psb_c_cuda_csrg_mat_mod use psb_z_cuda_csrg_mat_mod -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 use psb_s_cuda_hybg_mat_mod use psb_d_cuda_hybg_mat_mod use psb_c_cuda_hybg_mat_mod diff --git a/cuda/psb_d_cuda_diag_mat_mod.F90 b/cuda/psb_d_cuda_diag_mat_mod.F90 index 11e4e349..3f570799 100644 --- a/cuda/psb_d_cuda_diag_mat_mod.F90 +++ b/cuda/psb_d_cuda_diag_mat_mod.F90 @@ -41,8 +41,6 @@ module psb_d_cuda_diag_mat_mod ! ITPACK/HLL format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of HLL, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr diff --git a/cuda/psb_d_cuda_dnsg_mat_mod.F90 b/cuda/psb_d_cuda_dnsg_mat_mod.F90 index f11e7823..ffa17eeb 100644 --- a/cuda/psb_d_cuda_dnsg_mat_mod.F90 +++ b/cuda/psb_d_cuda_dnsg_mat_mod.F90 @@ -42,8 +42,6 @@ module psb_d_cuda_dnsg_mat_mod ! ITPACK/DNS format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of DNS, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr diff --git a/cuda/psb_d_cuda_elg_mat_mod.F90 b/cuda/psb_d_cuda_elg_mat_mod.F90 index 1af80f2a..3fde2075 100644 --- a/cuda/psb_d_cuda_elg_mat_mod.F90 +++ b/cuda/psb_d_cuda_elg_mat_mod.F90 @@ -46,8 +46,6 @@ module psb_d_cuda_elg_mat_mod ! ITPACK/ELL format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of ELL, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr integer(psb_ipk_) :: devstate = is_host diff --git a/cuda/psb_d_cuda_hlg_mat_mod.F90 b/cuda/psb_d_cuda_hlg_mat_mod.F90 index 6627f824..a1a2539d 100644 --- a/cuda/psb_d_cuda_hlg_mat_mod.F90 +++ b/cuda/psb_d_cuda_hlg_mat_mod.F90 @@ -46,8 +46,6 @@ module psb_d_cuda_hlg_mat_mod ! ITPACK/HLL format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of HLL, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr integer :: devstate = is_host diff --git a/cuda/psb_d_cuda_hybg_mat_mod.F90 b/cuda/psb_d_cuda_hybg_mat_mod.F90 index 065c0db3..4ff72f51 100644 --- a/cuda/psb_d_cuda_hybg_mat_mod.F90 +++ b/cuda/psb_d_cuda_hybg_mat_mod.F90 @@ -29,7 +29,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 module psb_d_cuda_hybg_mat_mod diff --git a/cuda/psb_i_cuda_diag_mat_mod.F90 b/cuda/psb_i_cuda_diag_mat_mod.F90 index 98090f06..2862d2eb 100644 --- a/cuda/psb_i_cuda_diag_mat_mod.F90 +++ b/cuda/psb_i_cuda_diag_mat_mod.F90 @@ -41,8 +41,6 @@ module psb_i_cuda_diag_mat_mod ! ITPACK/HLL format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of HLL, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr diff --git a/cuda/psb_i_cuda_dnsg_mat_mod.F90 b/cuda/psb_i_cuda_dnsg_mat_mod.F90 index 6586d115..f3079d9e 100644 --- a/cuda/psb_i_cuda_dnsg_mat_mod.F90 +++ b/cuda/psb_i_cuda_dnsg_mat_mod.F90 @@ -42,8 +42,6 @@ module psb_i_cuda_dnsg_mat_mod ! ITPACK/DNS format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of DNS, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr diff --git a/cuda/psb_i_cuda_elg_mat_mod.F90 b/cuda/psb_i_cuda_elg_mat_mod.F90 index 48311eea..bd975d51 100644 --- a/cuda/psb_i_cuda_elg_mat_mod.F90 +++ b/cuda/psb_i_cuda_elg_mat_mod.F90 @@ -46,8 +46,6 @@ module psb_i_cuda_elg_mat_mod ! ITPACK/ELL format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of ELL, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr integer(psb_ipk_) :: devstate = is_host diff --git a/cuda/psb_i_cuda_hlg_mat_mod.F90 b/cuda/psb_i_cuda_hlg_mat_mod.F90 index b4e3046e..8b9dc654 100644 --- a/cuda/psb_i_cuda_hlg_mat_mod.F90 +++ b/cuda/psb_i_cuda_hlg_mat_mod.F90 @@ -46,8 +46,6 @@ module psb_i_cuda_hlg_mat_mod ! ITPACK/HLL format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of HLL, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr integer :: devstate = is_host diff --git a/cuda/psb_i_cuda_hybg_mat_mod.F90 b/cuda/psb_i_cuda_hybg_mat_mod.F90 index f6fc3110..eb38e498 100644 --- a/cuda/psb_i_cuda_hybg_mat_mod.F90 +++ b/cuda/psb_i_cuda_hybg_mat_mod.F90 @@ -29,7 +29,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 module psb_i_cuda_hybg_mat_mod diff --git a/cuda/psb_s_cuda_diag_mat_mod.F90 b/cuda/psb_s_cuda_diag_mat_mod.F90 index b13a8502..30386618 100644 --- a/cuda/psb_s_cuda_diag_mat_mod.F90 +++ b/cuda/psb_s_cuda_diag_mat_mod.F90 @@ -41,8 +41,6 @@ module psb_s_cuda_diag_mat_mod ! ITPACK/HLL format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of HLL, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr diff --git a/cuda/psb_s_cuda_dnsg_mat_mod.F90 b/cuda/psb_s_cuda_dnsg_mat_mod.F90 index 8193655e..07b49f03 100644 --- a/cuda/psb_s_cuda_dnsg_mat_mod.F90 +++ b/cuda/psb_s_cuda_dnsg_mat_mod.F90 @@ -42,8 +42,6 @@ module psb_s_cuda_dnsg_mat_mod ! ITPACK/DNS format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of DNS, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr diff --git a/cuda/psb_s_cuda_elg_mat_mod.F90 b/cuda/psb_s_cuda_elg_mat_mod.F90 index 1aa9d36d..0626fd24 100644 --- a/cuda/psb_s_cuda_elg_mat_mod.F90 +++ b/cuda/psb_s_cuda_elg_mat_mod.F90 @@ -46,8 +46,6 @@ module psb_s_cuda_elg_mat_mod ! ITPACK/ELL format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of ELL, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr integer(psb_ipk_) :: devstate = is_host diff --git a/cuda/psb_s_cuda_hlg_mat_mod.F90 b/cuda/psb_s_cuda_hlg_mat_mod.F90 index 4f7b4b6f..7b8c49b5 100644 --- a/cuda/psb_s_cuda_hlg_mat_mod.F90 +++ b/cuda/psb_s_cuda_hlg_mat_mod.F90 @@ -46,8 +46,6 @@ module psb_s_cuda_hlg_mat_mod ! ITPACK/HLL format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of HLL, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr integer :: devstate = is_host diff --git a/cuda/psb_s_cuda_hybg_mat_mod.F90 b/cuda/psb_s_cuda_hybg_mat_mod.F90 index f1446b15..b4a7cd75 100644 --- a/cuda/psb_s_cuda_hybg_mat_mod.F90 +++ b/cuda/psb_s_cuda_hybg_mat_mod.F90 @@ -29,7 +29,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 module psb_s_cuda_hybg_mat_mod diff --git a/cuda/psb_z_cuda_diag_mat_mod.F90 b/cuda/psb_z_cuda_diag_mat_mod.F90 index 592d50b2..8b0d2168 100644 --- a/cuda/psb_z_cuda_diag_mat_mod.F90 +++ b/cuda/psb_z_cuda_diag_mat_mod.F90 @@ -41,8 +41,6 @@ module psb_z_cuda_diag_mat_mod ! ITPACK/HLL format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of HLL, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr diff --git a/cuda/psb_z_cuda_dnsg_mat_mod.F90 b/cuda/psb_z_cuda_dnsg_mat_mod.F90 index 3669d6ac..6f687a75 100644 --- a/cuda/psb_z_cuda_dnsg_mat_mod.F90 +++ b/cuda/psb_z_cuda_dnsg_mat_mod.F90 @@ -42,8 +42,6 @@ module psb_z_cuda_dnsg_mat_mod ! ITPACK/DNS format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of DNS, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr diff --git a/cuda/psb_z_cuda_elg_mat_mod.F90 b/cuda/psb_z_cuda_elg_mat_mod.F90 index bd36e4b6..1348a7cb 100644 --- a/cuda/psb_z_cuda_elg_mat_mod.F90 +++ b/cuda/psb_z_cuda_elg_mat_mod.F90 @@ -46,8 +46,6 @@ module psb_z_cuda_elg_mat_mod ! ITPACK/ELL format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of ELL, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr integer(psb_ipk_) :: devstate = is_host diff --git a/cuda/psb_z_cuda_hlg_mat_mod.F90 b/cuda/psb_z_cuda_hlg_mat_mod.F90 index 2acf43f1..f7150250 100644 --- a/cuda/psb_z_cuda_hlg_mat_mod.F90 +++ b/cuda/psb_z_cuda_hlg_mat_mod.F90 @@ -46,8 +46,6 @@ module psb_z_cuda_hlg_mat_mod ! ITPACK/HLL format, extended. ! We are adding here the routines to create a copy of the data ! into the GPU. - ! If HAVE_SPGPU is undefined this is just - ! a copy of HLL, indistinguishable. ! type(c_ptr) :: deviceMat = c_null_ptr integer :: devstate = is_host diff --git a/cuda/psb_z_cuda_hybg_mat_mod.F90 b/cuda/psb_z_cuda_hybg_mat_mod.F90 index 96620300..efcd73f7 100644 --- a/cuda/psb_z_cuda_hybg_mat_mod.F90 +++ b/cuda/psb_z_cuda_hybg_mat_mod.F90 @@ -29,7 +29,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 module psb_z_cuda_hybg_mat_mod diff --git a/cuda/s_cusparse_mod.F90 b/cuda/s_cusparse_mod.F90 index a0214110..24adfdba 100644 --- a/cuda/s_cusparse_mod.F90 +++ b/cuda/s_cusparse_mod.F90 @@ -37,7 +37,7 @@ module s_cusparse_mod type(c_ptr) :: Mat = c_null_ptr end type s_Cmat -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 type, bind(c) :: s_Hmat type(c_ptr) :: Mat = c_null_ptr end type s_Hmat @@ -97,7 +97,7 @@ module s_cusparse_mod end function s_CSRGDeviceSetMatIndexBase end interface -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 interface CSRGDeviceCsrsmAnalysis function s_CSRGDeviceCsrsmAnalysis(Mat) & & bind(c,name="s_CSRGDeviceCsrsmAnalysis") result(res) @@ -193,7 +193,7 @@ module s_cusparse_mod end function s_CSRGDevice2Host end interface -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 interface HYBGDeviceAlloc function s_HYBGDeviceAlloc(Mat,nr,nc,nz) & & bind(c,name="s_HYBGDeviceAlloc") result(res) diff --git a/cuda/scusparse.h b/cuda/scusparse.h index 479f5069..a5e53446 100644 --- a/cuda/scusparse.h +++ b/cuda/scusparse.h @@ -54,7 +54,7 @@ #define T_CSRGDeviceSetMatDiagType s_CSRGDeviceSetMatDiagType #define T_CSRGDeviceGetParms s_CSRGDeviceGetParms -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 #define T_CSRGDeviceSetMatType s_CSRGDeviceSetMatType #define T_CSRGDeviceSetMatIndexBase s_CSRGDeviceSetMatIndexBase #define T_CSRGDeviceCsrsmAnalysis s_CSRGDeviceCsrsmAnalysis @@ -78,7 +78,7 @@ #define cusparseThybsv_analysis cusparseShybsv_analysis #define cusparseTcsr2hyb cusparseScsr2hyb -#elif CUDA_VERSION < 11030 +#elif PSB_CUDA_VERSION < 11030 #define T_CSRGDeviceSetMatType s_CSRGDeviceSetMatType #define T_CSRGDeviceSetMatIndexBase s_CSRGDeviceSetMatIndexBase diff --git a/cuda/z_cusparse_mod.F90 b/cuda/z_cusparse_mod.F90 index 91a6fcbd..a4f15455 100644 --- a/cuda/z_cusparse_mod.F90 +++ b/cuda/z_cusparse_mod.F90 @@ -37,7 +37,7 @@ module z_cusparse_mod type(c_ptr) :: Mat = c_null_ptr end type z_Cmat -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 type, bind(c) :: z_Hmat type(c_ptr) :: Mat = c_null_ptr end type z_Hmat @@ -97,7 +97,7 @@ module z_cusparse_mod end function z_CSRGDeviceSetMatIndexBase end interface -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 interface CSRGDeviceCsrsmAnalysis function z_CSRGDeviceCsrsmAnalysis(Mat) & & bind(c,name="z_CSRGDeviceCsrsmAnalysis") result(res) @@ -193,7 +193,7 @@ module z_cusparse_mod end function z_CSRGDevice2Host end interface -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 interface HYBGDeviceAlloc function z_HYBGDeviceAlloc(Mat,nr,nc,nz) & & bind(c,name="z_HYBGDeviceAlloc") result(res) diff --git a/cuda/zcusparse.h b/cuda/zcusparse.h index b63aa103..ca0aeeff 100644 --- a/cuda/zcusparse.h +++ b/cuda/zcusparse.h @@ -54,7 +54,7 @@ #define T_CSRGDeviceSetMatDiagType z_CSRGDeviceSetMatDiagType #define T_CSRGDeviceGetParms z_CSRGDeviceGetParms -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 #define T_CSRGDeviceSetMatType z_CSRGDeviceSetMatType #define T_CSRGDeviceSetMatIndexBase z_CSRGDeviceSetMatIndexBase #define T_CSRGDeviceCsrsmAnalysis z_CSRGDeviceCsrsmAnalysis @@ -78,7 +78,7 @@ #define cusparseThybsv_analysis cusparseZhybsv_analysis #define cusparseTcsr2hyb cusparseZcsr2hyb -#elif CUDA_VERSION < 11030 +#elif PSB_CUDA_VERSION < 11030 #define T_CSRGDeviceSetMatType z_CSRGDeviceSetMatType #define T_CSRGDeviceSetMatIndexBase z_CSRGDeviceSetMatIndexBase diff --git a/linsolve/impl/psb_dcg.F90 b/linsolve/impl/psb_dcg.F90 index 14c978bb..a5993731 100644 --- a/linsolve/impl/psb_dcg.F90 +++ b/linsolve/impl/psb_dcg.F90 @@ -295,7 +295,7 @@ subroutine psb_dcg_vect(a,prec,b,x,eps,desc_a,info,& end do restart if (do_cond) then if (me == psb_root_) then -#if defined(HAVE_LAPACK) +#if defined(PSB_HAVE_LAPACK) call dstebz('A','E',istebz,dzero,dzero,0,0,-done,td,tu,& & ieg,nspl,eig,ibl,ispl,ewrk,iwrk,info) if (info < 0) then diff --git a/linsolve/impl/psb_scg.F90 b/linsolve/impl/psb_scg.F90 index d3485db5..c116edc4 100644 --- a/linsolve/impl/psb_scg.F90 +++ b/linsolve/impl/psb_scg.F90 @@ -295,7 +295,7 @@ subroutine psb_scg_vect(a,prec,b,x,eps,desc_a,info,& end do restart if (do_cond) then if (me == psb_root_) then -#if defined(HAVE_LAPACK) +#if defined(PSB_HAVE_LAPACK) call sstebz('A','E',istebz,szero,szero,0,0,-sone,td,tu,& & ieg,nspl,eig,ibl,ispl,ewrk,iwrk,info) if (info < 0) then diff --git a/prec/psb_c_biconjg_mod.F90 b/prec/psb_c_biconjg_mod.F90 index 6af30b4f..e6fdaa95 100644 --- a/prec/psb_c_biconjg_mod.F90 +++ b/prec/psb_c_biconjg_mod.F90 @@ -128,10 +128,10 @@ module psb_c_biconjg_mod & psb_csparse_biconjg_s_llk, psb_csparse_biconjg_s_ft_llk,& & psb_csparse_biconjg_llk_noth, psb_csparse_biconjg_mlk -#if defined(HAVE_TUMA_SAINV) - procedure(psb_csparse_biconjg_variant) :: psb_csparse_tuma_sainv,& - & psb_csparse_tuma_lainv -#endif +!#if defined(PSB_HAVE_TUMA_SAINV) +! procedure(psb_csparse_biconjg_variant) :: psb_csparse_tuma_sainv,& +! & psb_csparse_tuma_lainv +!#endif contains @@ -179,7 +179,7 @@ contains call psb_csparse_biconjg_s_ft_llk(n,acsr,p,zcsc,wcsc,nzrmax,sp_thresh,info) case (psb_ainv_llk_noth_) call psb_csparse_biconjg_llk_noth(n,acsr,p,zcsc,wcsc,nzrmax,sp_thresh,info) -!#if defined(HAVE_TUMA_SAINV) +!#if defined(PSB_HAVE_TUMA_SAINV) ! case (psb_ainv_s_tuma_) ! call psb_csparse_tuma_sainv(n,acsr,p,zcsc,wcsc,nzrmax,sp_thresh,info) ! case (psb_ainv_l_tuma_) diff --git a/prec/psb_d_biconjg_mod.F90 b/prec/psb_d_biconjg_mod.F90 index 09358744..696ecbaa 100644 --- a/prec/psb_d_biconjg_mod.F90 +++ b/prec/psb_d_biconjg_mod.F90 @@ -128,10 +128,10 @@ module psb_d_biconjg_mod & psb_dsparse_biconjg_s_llk, psb_dsparse_biconjg_s_ft_llk,& & psb_dsparse_biconjg_llk_noth, psb_dsparse_biconjg_mlk -#if defined(HAVE_TUMA_SAINV) - procedure(psb_dsparse_biconjg_variant) :: psb_dsparse_tuma_sainv,& - & psb_dsparse_tuma_lainv -#endif +!#if defined(PSB_HAVE_TUMA_SAINV) +! procedure(psb_dsparse_biconjg_variant) :: psb_dsparse_tuma_sainv,& +! & psb_dsparse_tuma_lainv +!#endif contains @@ -179,7 +179,7 @@ contains call psb_dsparse_biconjg_s_ft_llk(n,acsr,p,zcsc,wcsc,nzrmax,sp_thresh,info) case (psb_ainv_llk_noth_) call psb_dsparse_biconjg_llk_noth(n,acsr,p,zcsc,wcsc,nzrmax,sp_thresh,info) -!#if defined(HAVE_TUMA_SAINV) +!#if defined(PSB_HAVE_TUMA_SAINV) ! case (psb_ainv_s_tuma_) ! call psb_dsparse_tuma_sainv(n,acsr,p,zcsc,wcsc,nzrmax,sp_thresh,info) ! case (psb_ainv_l_tuma_) diff --git a/prec/psb_s_biconjg_mod.F90 b/prec/psb_s_biconjg_mod.F90 index bc2aaefc..46fe3a0a 100644 --- a/prec/psb_s_biconjg_mod.F90 +++ b/prec/psb_s_biconjg_mod.F90 @@ -128,10 +128,10 @@ module psb_s_biconjg_mod & psb_ssparse_biconjg_s_llk, psb_ssparse_biconjg_s_ft_llk,& & psb_ssparse_biconjg_llk_noth, psb_ssparse_biconjg_mlk -#if defined(HAVE_TUMA_SAINV) - procedure(psb_ssparse_biconjg_variant) :: psb_ssparse_tuma_sainv,& - & psb_ssparse_tuma_lainv -#endif +!#if defined(PSB_HAVE_TUMA_SAINV) +! procedure(psb_ssparse_biconjg_variant) :: psb_ssparse_tuma_sainv,& +! & psb_ssparse_tuma_lainv +!#endif contains @@ -179,7 +179,7 @@ contains call psb_ssparse_biconjg_s_ft_llk(n,acsr,p,zcsc,wcsc,nzrmax,sp_thresh,info) case (psb_ainv_llk_noth_) call psb_ssparse_biconjg_llk_noth(n,acsr,p,zcsc,wcsc,nzrmax,sp_thresh,info) -!#if defined(HAVE_TUMA_SAINV) +!#if defined(PSB_HAVE_TUMA_SAINV) ! case (psb_ainv_s_tuma_) ! call psb_ssparse_tuma_sainv(n,acsr,p,zcsc,wcsc,nzrmax,sp_thresh,info) ! case (psb_ainv_l_tuma_) diff --git a/prec/psb_z_biconjg_mod.F90 b/prec/psb_z_biconjg_mod.F90 index b40485e7..bb193f57 100644 --- a/prec/psb_z_biconjg_mod.F90 +++ b/prec/psb_z_biconjg_mod.F90 @@ -128,10 +128,10 @@ module psb_z_biconjg_mod & psb_zsparse_biconjg_s_llk, psb_zsparse_biconjg_s_ft_llk,& & psb_zsparse_biconjg_llk_noth, psb_zsparse_biconjg_mlk -#if defined(HAVE_TUMA_SAINV) - procedure(psb_zsparse_biconjg_variant) :: psb_zsparse_tuma_sainv,& - & psb_zsparse_tuma_lainv -#endif +!#if defined(PSB_HAVE_TUMA_SAINV) +! procedure(psb_zsparse_biconjg_variant) :: psb_zsparse_tuma_sainv,& +! & psb_zsparse_tuma_lainv +!#endif contains @@ -179,7 +179,7 @@ contains call psb_zsparse_biconjg_s_ft_llk(n,acsr,p,zcsc,wcsc,nzrmax,sp_thresh,info) case (psb_ainv_llk_noth_) call psb_zsparse_biconjg_llk_noth(n,acsr,p,zcsc,wcsc,nzrmax,sp_thresh,info) -!#if defined(HAVE_TUMA_SAINV) +!#if defined(PSB_HAVE_TUMA_SAINV) ! case (psb_ainv_s_tuma_) ! call psb_zsparse_tuma_sainv(n,acsr,p,zcsc,wcsc,nzrmax,sp_thresh,info) ! case (psb_ainv_l_tuma_) diff --git a/test/cudakern/dpdegenmv.F90 b/test/cudakern/dpdegenmv.F90 index c31c58da..d97a06aa 100644 --- a/test/cudakern/dpdegenmv.F90 +++ b/test/cudakern/dpdegenmv.F90 @@ -558,7 +558,7 @@ program pdgenmv use psb_base_mod use psb_util_mod use psb_ext_mod -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA use psb_cuda_mod #endif #ifdef HAVE_RSB @@ -583,7 +583,7 @@ program pdgenmv type(psb_desc_type) :: desc_a ! dense matrices type(psb_d_vect_type), target :: xv, bv, xg, bg -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA type(psb_d_vect_cuda) :: vmold type(psb_i_vect_cuda) :: imold #endif @@ -605,10 +605,10 @@ program pdgenmv #ifdef HAVE_RSB type(psb_d_rsb_sparse_mat), target :: arsb #endif -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA type(psb_d_cuda_elg_sparse_mat), target :: aelg type(psb_d_cuda_csrg_sparse_mat), target :: acsrg -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 type(psb_d_cuda_hybg_sparse_mat), target :: ahybg #endif type(psb_d_cuda_hlg_sparse_mat), target :: ahlg @@ -629,7 +629,7 @@ program pdgenmv call psb_init(ctxt) call psb_info(ctxt,iam,np) -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA call psb_cuda_init(ctxt) #endif #ifdef HAVE_RSB @@ -650,7 +650,7 @@ program pdgenmv write(*,*) 'Welcome to PSBLAS version: ',psb_version_string_ write(*,*) 'This is the ',trim(name),' sample program' end if -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA write(*,*) 'Process ',iam,' running on device: ', psb_cuda_getDevice(),' out of', psb_cuda_getDeviceCount() write(*,*) 'Process ',iam,' device ', psb_cuda_getDevice(),' is a: ', trim(psb_cuda_DeviceName()) #endif @@ -709,7 +709,7 @@ program pdgenmv stop end if -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA select case(psb_toupper(agfmt)) case('ELG') agmold => aelg @@ -721,7 +721,7 @@ program pdgenmv agmold => acsrg case('DNSG') agmold => adnsg -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 case('HYBG') agmold => ahybg #endif @@ -764,7 +764,7 @@ program pdgenmv call xv%bld(x0) call psb_geasb(bv,desc_a,info,scratch=.true.) -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA call aux_a%cscnv(agpu,info,mold=acoo) call xg%bld(x0,mold=vmold) @@ -791,7 +791,7 @@ program pdgenmv t2 = psb_wtime() - t1 call psb_amx(ctxt,t2) -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA call xg%set(x0) ! FIXME: cache flush needed here @@ -887,7 +887,7 @@ program pdgenmv tflops = flops gflops = flops * ngpu write(psb_out_unit,'("Storage type for A: ",a)') a%get_fmt() -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA write(psb_out_unit,'("Storage type for AGPU: ",a)') agpu%get_fmt() write(psb_out_unit,'("Time to convert A from COO to CPU (1): ",F20.9)')& & tcnvc1 @@ -917,7 +917,7 @@ program pdgenmv & t2*1.d3/(1.d0*ntests) write(psb_out_unit,'("MFLOPS (CPU) : ",F20.3)')& & flops/1.d6 -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA write(psb_out_unit,'("Time for ",i6," products (s) (xGPU) : ",F20.3)')& & ntests, tt2 write(psb_out_unit,'("Time per product (ms) (xGPU) : ",F20.3)')& @@ -942,7 +942,7 @@ program pdgenmv bdwdth = ntests*nbytes/(t2*1.d6) write(psb_out_unit,*) write(psb_out_unit,'("MBYTES/S sust. effective bandwidth (CPU) : ",F20.3)') bdwdth -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA bdwdth = ngpu*ntests*nbytes/(gt2*1.d6) write(psb_out_unit,'("MBYTES/S sust. effective bandwidth (GPU) : ",F20.3)') bdwdth bdwdth = psb_cuda_MemoryPeakBandwidth() @@ -967,7 +967,7 @@ program pdgenmv call psb_errpush(info,name,a_err=ch_err) goto 9999 end if -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA call psb_cuda_exit() #endif call psb_exit(ctxt) diff --git a/test/cudakern/spdegenmv.F90 b/test/cudakern/spdegenmv.F90 index e171f52d..7e828011 100644 --- a/test/cudakern/spdegenmv.F90 +++ b/test/cudakern/spdegenmv.F90 @@ -547,7 +547,7 @@ program pdgenmv use psb_base_mod use psb_util_mod use psb_ext_mod -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA use psb_cuda_mod #endif use psb_s_pde3d_mod @@ -569,7 +569,7 @@ program pdgenmv type(psb_desc_type) :: desc_a ! dense matrices type(psb_s_vect_type), target :: xv,bv, xg, bg -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA type(psb_s_vect_cuda) :: vmold type(psb_i_vect_cuda) :: imold #endif @@ -588,10 +588,10 @@ program pdgenmv type(psb_s_hll_sparse_mat), target :: ahll type(psb_s_dia_sparse_mat), target :: adia type(psb_s_hdia_sparse_mat), target :: ahdia -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA type(psb_s_cuda_elg_sparse_mat), target :: aelg type(psb_s_cuda_csrg_sparse_mat), target :: acsrg -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 type(psb_s_cuda_hybg_sparse_mat), target :: ahybg #endif type(psb_s_cuda_hlg_sparse_mat), target :: ahlg @@ -612,7 +612,7 @@ program pdgenmv call psb_init(ctxt) call psb_info(ctxt,iam,np) -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA call psb_cuda_init(ctxt) #endif #ifdef HAVE_RSB @@ -633,7 +633,7 @@ program pdgenmv write(*,*) 'Welcome to PSBLAS version: ',psb_version_string_ write(*,*) 'This is the ',trim(name),' sample program' end if -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA write(*,*) 'Process ',iam,' running on device: ', psb_cuda_getDevice(),' out of', psb_cuda_getDeviceCount() write(*,*) 'Process ',iam,' device ', psb_cuda_getDevice(),' is a: ', trim(psb_cuda_DeviceName()) #endif @@ -692,7 +692,7 @@ program pdgenmv stop end if -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA select case(psb_toupper(agfmt)) case('ELG') agmold => aelg @@ -704,7 +704,7 @@ program pdgenmv agmold => acsrg case('DNSG') agmold => adnsg -#if CUDA_SHORT_VERSION <= 10 +#if PSB_CUDA_SHORT_VERSION <= 10 case('HYBG') agmold => ahybg #endif @@ -747,7 +747,7 @@ program pdgenmv call xv%bld(x0) call psb_geasb(bv,desc_a,info,scratch=.true.) -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA call aux_a%cscnv(agpu,info,mold=acoo) call xg%bld(x0,mold=vmold) @@ -774,7 +774,7 @@ program pdgenmv t2 = psb_wtime() - t1 call psb_amx(ctxt,t2) -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA call xg%set(x0) ! FIXME: cache flush needed here @@ -870,7 +870,7 @@ program pdgenmv tflops = flops gflops = flops * ngpu write(psb_out_unit,'("Storage type for A: ",a)') a%get_fmt() -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA write(psb_out_unit,'("Storage type for AGPU: ",a)') agpu%get_fmt() write(psb_out_unit,'("Time to convert A from COO to CPU (1): ",F20.9)')& & tcnvc1 @@ -900,7 +900,7 @@ program pdgenmv & t2*1.d3/(1.d0*ntests) write(psb_out_unit,'("MFLOPS (CPU) : ",F20.3)')& & flops/1.d6 -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA write(psb_out_unit,'("Time for ",i6," products (s) (xGPU) : ",F20.3)')& & ntests, tt2 write(psb_out_unit,'("Time per product (ms) (xGPU) : ",F20.3)')& @@ -925,7 +925,7 @@ program pdgenmv bdwdth = ntests*nbytes/(t2*1.d6) write(psb_out_unit,*) write(psb_out_unit,'("MBYTES/S sust. effective bandwidth (CPU) : ",F20.3)') bdwdth -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA bdwdth = ngpu*ntests*nbytes/(gt2*1.d6) write(psb_out_unit,'("MBYTES/S sust. effective bandwidth (GPU) : ",F20.3)') bdwdth bdwdth = psb_cuda_MemoryPeakBandwidth() @@ -949,7 +949,7 @@ program pdgenmv call psb_errpush(info,name,a_err=ch_err) goto 9999 end if -#ifdef HAVE_CUDA +#ifdef PSB_HAVE_CUDA call psb_cuda_exit() #endif call psb_exit(ctxt) diff --git a/test/omp/psb_tomp.F90 b/test/omp/psb_tomp.F90 index a2b21ef7..3e303594 100644 --- a/test/omp/psb_tomp.F90 +++ b/test/omp/psb_tomp.F90 @@ -172,7 +172,7 @@ contains & f,amold,vmold,imold,partition,nrl,iv) use psb_base_mod use psb_util_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif ! @@ -332,7 +332,7 @@ contains ! A nifty MPI function will split the process list npdims = 0 -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) npdims = 1 #else call mpi_dims_create(np,3,npdims,info) @@ -459,7 +459,7 @@ contains integer(psb_lpk_), allocatable :: irow(:),icol(:) real(psb_dpk_), allocatable :: val(:) real(psb_dpk_) :: x,y,z, zt(nb) -#if defined(OPENMP) +#if defined(PSB_OPENMP) nth = omp_get_num_threads() ith = omp_get_thread_num() #else @@ -562,7 +562,7 @@ contains endif end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) !!$ write(0,*) omp_get_thread_num(),' Check insertion ',& !!$ & irow(1:icoeff-1),':',icol(1:icoeff-1) #endif @@ -661,7 +661,7 @@ program psb_d_pde3d use psb_linsolve_mod use psb_util_mod use psb_d_pde3d_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -710,7 +710,7 @@ program psb_d_pde3d call psb_init(ctxt) call psb_info(ctxt,iam,np) -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP parallel shared(nth) !$OMP master nth = omp_get_num_threads() diff --git a/test/openacc/psb_d_oacc_pde3d.F90 b/test/openacc/psb_d_oacc_pde3d.F90 index 13f2b81c..841da878 100644 --- a/test/openacc/psb_d_oacc_pde3d.F90 +++ b/test/openacc/psb_d_oacc_pde3d.F90 @@ -172,7 +172,7 @@ contains & f,amold,vmold,imold,partition,nrl,iv) use psb_base_mod use psb_util_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif ! @@ -332,7 +332,7 @@ contains ! A nifty MPI function will split the process list npdims = 0 -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) npdims = 1 #else call mpi_dims_create(np,3,npdims,info) @@ -458,7 +458,7 @@ contains integer(psb_lpk_), allocatable :: irow(:),icol(:) real(psb_dpk_), allocatable :: val(:) real(psb_dpk_) :: x,y,z, zt(nb) -#if defined(OPENMP) +#if defined(PSB_OPENMP) nth = omp_get_num_threads() ith = omp_get_thread_num() #else @@ -557,7 +557,7 @@ contains endif end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) !!$ write(0,*) omp_get_thread_num(),' Check insertion ',& !!$ & irow(1:icoeff-1),':',icol(1:icoeff-1) #endif diff --git a/test/pargen/psb_d_pde2d.F90 b/test/pargen/psb_d_pde2d.F90 index a7de0585..49c339d6 100644 --- a/test/pargen/psb_d_pde2d.F90 +++ b/test/pargen/psb_d_pde2d.F90 @@ -156,7 +156,7 @@ contains & f,amold,vmold,imold,partition,nrl,iv) use psb_base_mod use psb_util_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif ! @@ -316,7 +316,7 @@ contains ! A nifty MPI function will split the process list npdims = 0 -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) npdims = 1 #else call mpi_dims_create(np,2,npdims,info) @@ -422,7 +422,10 @@ contains call psb_barrier(ctxt) t1 = psb_wtime() +#if 0 + !Disable parallel generation for the time being !$omp parallel shared(deltah,myidx,a,desc_a) +#endif ! block integer(psb_ipk_) :: i,j,k,ii,ib,icoeff, ix,iy, ith,nth @@ -430,7 +433,7 @@ contains integer(psb_lpk_), allocatable :: irow(:),icol(:) real(psb_dpk_), allocatable :: val(:) real(psb_dpk_) :: x,y, zt(nb) -#if defined(OPENMP) +#if defined(PSB_OPENMP) nth = omp_get_num_threads() ith = omp_get_thread_num() #else @@ -445,7 +448,10 @@ contains !goto 9999 endif +#if 0 + !Disable parallel generation for the time being !$omp do schedule(dynamic) +#endif ! do ii=1, nlr,nb if(info /= psb_success_) cycle @@ -509,7 +515,7 @@ contains endif end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) !!$ write(0,*) omp_get_thread_num(),' Check insertion ',& !!$ & irow(1:icoeff-1),':',icol(1:icoeff-1) #endif @@ -521,10 +527,16 @@ contains call psb_geins(ib,myidx(ii:ii+ib-1),zt(1:ib),xv,desc_a,info) if(info /= psb_success_) cycle end do +#if 0 + !Disable parallel generation for the time being !$omp end do +#endif deallocate(val,irow,icol) end block +#if 0 + !Disable parallel generation for the time being !$omp end parallel +#endif tgen = psb_wtime()-t1 @@ -598,7 +610,7 @@ program psb_d_pde2d use psb_linsolve_mod use psb_util_mod use psb_d_pde2d_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -647,7 +659,7 @@ program psb_d_pde2d call psb_init(ctxt) call psb_info(ctxt,iam,np) -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP parallel shared(nth) !$OMP master nth = omp_get_num_threads() diff --git a/test/pargen/psb_d_pde3d.F90 b/test/pargen/psb_d_pde3d.F90 index d634f245..b45856fa 100644 --- a/test/pargen/psb_d_pde3d.F90 +++ b/test/pargen/psb_d_pde3d.F90 @@ -172,7 +172,7 @@ contains & f,amold,vmold,imold,partition,nrl,iv) use psb_base_mod use psb_util_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif ! @@ -332,7 +332,7 @@ contains ! A nifty MPI function will split the process list npdims = 0 -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) npdims = 1 #else call mpi_dims_create(np,3,npdims,info) @@ -450,7 +450,10 @@ contains call psb_barrier(ctxt) t1 = psb_wtime() +#if 0 + !Disable parallel generation for the time being !$omp parallel shared(deltah,myidx,a,desc_a) +#endif ! block integer(psb_ipk_) :: i,j,k,ii,ib,icoeff, ix,iy,iz, ith,nth @@ -458,7 +461,7 @@ contains integer(psb_lpk_), allocatable :: irow(:),icol(:) real(psb_dpk_), allocatable :: val(:) real(psb_dpk_) :: x,y,z, zt(nb) -#if defined(OPENMP) +#if defined(PSB_OPENMP) nth = omp_get_num_threads() ith = omp_get_thread_num() #else @@ -473,7 +476,10 @@ contains !goto 9999 endif +#if 0 + !Disable parallel generation for the time being !$omp do schedule(dynamic) +#endif ! do ii=1, nlr, nb if(info /= psb_success_) cycle @@ -557,7 +563,7 @@ contains endif end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) !!$ write(0,*) omp_get_thread_num(),' Check insertion ',& !!$ & irow(1:icoeff-1),':',icol(1:icoeff-1) #endif @@ -569,11 +575,16 @@ contains call psb_geins(ib,myidx(ii:ii+ib-1),zt(1:ib),xv,desc_a,info) if(info /= psb_success_) cycle end do +#if 0 + !Disable parallel generation for the time being !$omp end do +#endif deallocate(val,irow,icol) end block +#if 0 + !Disable parallel generation for the time being !$omp end parallel - +#endif tgen = psb_wtime()-t1 if(info /= psb_success_) then info=psb_err_from_subroutine_ @@ -656,7 +667,7 @@ program psb_d_pde3d use psb_linsolve_mod use psb_util_mod use psb_d_pde3d_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -705,7 +716,7 @@ program psb_d_pde3d call psb_init(ctxt) call psb_info(ctxt,iam,np) -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP parallel shared(nth) !$OMP master nth = omp_get_num_threads() diff --git a/test/pargen/psb_s_pde2d.F90 b/test/pargen/psb_s_pde2d.F90 index 14b45a0f..4df1c05c 100644 --- a/test/pargen/psb_s_pde2d.F90 +++ b/test/pargen/psb_s_pde2d.F90 @@ -156,7 +156,7 @@ contains & f,amold,vmold,imold,partition,nrl,iv) use psb_base_mod use psb_util_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif ! @@ -316,7 +316,7 @@ contains ! A nifty MPI function will split the process list npdims = 0 -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) npdims = 1 #else call mpi_dims_create(np,2,npdims,info) @@ -422,7 +422,10 @@ contains call psb_barrier(ctxt) t1 = psb_wtime() +#if 0 + !Disable parallel generation for the time being !$omp parallel shared(deltah,myidx,a,desc_a) +#endif ! block integer(psb_ipk_) :: i,j,k,ii,ib,icoeff, ix,iy, ith,nth @@ -430,7 +433,7 @@ contains integer(psb_lpk_), allocatable :: irow(:),icol(:) real(psb_spk_), allocatable :: val(:) real(psb_spk_) :: x,y, zt(nb) -#if defined(OPENMP) +#if defined(PSB_OPENMP) nth = omp_get_num_threads() ith = omp_get_thread_num() #else @@ -445,7 +448,10 @@ contains !goto 9999 endif +#if 0 + !Disable parallel generation for the time being !$omp do schedule(dynamic) +#endif ! do ii=1, nlr,nb if(info /= psb_success_) cycle @@ -509,7 +515,7 @@ contains endif end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) !!$ write(0,*) omp_get_thread_num(),' Check insertion ',& !!$ & irow(1:icoeff-1),':',icol(1:icoeff-1) #endif @@ -521,10 +527,16 @@ contains call psb_geins(ib,myidx(ii:ii+ib-1),zt(1:ib),xv,desc_a,info) if(info /= psb_success_) cycle end do +#if 0 + !Disable parallel generation for the time being !$omp end do +#endif deallocate(val,irow,icol) end block +#if 0 + !Disable parallel generation for the time being !$omp end parallel +#endif tgen = psb_wtime()-t1 @@ -598,7 +610,7 @@ program psb_s_pde2d use psb_linsolve_mod use psb_util_mod use psb_s_pde2d_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -647,7 +659,7 @@ program psb_s_pde2d call psb_init(ctxt) call psb_info(ctxt,iam,np) -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP parallel shared(nth) !$OMP master nth = omp_get_num_threads() diff --git a/test/pargen/psb_s_pde3d.F90 b/test/pargen/psb_s_pde3d.F90 index 51c6e849..f2e2f500 100644 --- a/test/pargen/psb_s_pde3d.F90 +++ b/test/pargen/psb_s_pde3d.F90 @@ -172,7 +172,7 @@ contains & f,amold,vmold,imold,partition,nrl,iv) use psb_base_mod use psb_util_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif ! @@ -332,7 +332,7 @@ contains ! A nifty MPI function will split the process list npdims = 0 -#if defined(SERIAL_MPI) +#if defined(PSB_SERIAL_MPI) npdims = 1 #else call mpi_dims_create(np,3,npdims,info) @@ -450,7 +450,10 @@ contains call psb_barrier(ctxt) t1 = psb_wtime() +#if 0 + !Disable parallel generation for the time being !$omp parallel shared(deltah,myidx,a,desc_a) +#endif ! block integer(psb_ipk_) :: i,j,k,ii,ib,icoeff, ix,iy,iz, ith,nth @@ -458,7 +461,7 @@ contains integer(psb_lpk_), allocatable :: irow(:),icol(:) real(psb_spk_), allocatable :: val(:) real(psb_spk_) :: x,y,z, zt(nb) -#if defined(OPENMP) +#if defined(PSB_OPENMP) nth = omp_get_num_threads() ith = omp_get_thread_num() #else @@ -473,7 +476,10 @@ contains !goto 9999 endif +#if 0 + !Disable parallel generation for the time being !$omp do schedule(dynamic) +#endif ! do ii=1, nlr, nb if(info /= psb_success_) cycle @@ -557,7 +563,7 @@ contains endif end do -#if defined(OPENMP) +#if defined(PSB_OPENMP) !!$ write(0,*) omp_get_thread_num(),' Check insertion ',& !!$ & irow(1:icoeff-1),':',icol(1:icoeff-1) #endif @@ -569,11 +575,16 @@ contains call psb_geins(ib,myidx(ii:ii+ib-1),zt(1:ib),xv,desc_a,info) if(info /= psb_success_) cycle end do +#if 0 + !Disable parallel generation for the time being !$omp end do +#endif deallocate(val,irow,icol) end block +#if 0 + !Disable parallel generation for the time being !$omp end parallel - +#endif tgen = psb_wtime()-t1 if(info /= psb_success_) then info=psb_err_from_subroutine_ @@ -656,7 +667,7 @@ program psb_s_pde3d use psb_linsolve_mod use psb_util_mod use psb_s_pde3d_mod -#if defined(OPENMP) +#if defined(PSB_OPENMP) use omp_lib #endif implicit none @@ -705,7 +716,7 @@ program psb_s_pde3d call psb_init(ctxt) call psb_info(ctxt,iam,np) -#if defined(OPENMP) +#if defined(PSB_OPENMP) !$OMP parallel shared(nth) !$OMP master nth = omp_get_num_threads() diff --git a/util/psb_amd_order.c b/util/psb_amd_order.c index 62c7c49f..5c2f1a18 100644 --- a/util/psb_amd_order.c +++ b/util/psb_amd_order.c @@ -29,14 +29,15 @@ POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_AMD_ +#include "psb_config.h" +#ifdef PSB_HAVE_AMD #include "amd.h" #endif int psb_amd_order(int n, int Ap[], int Ai[], int P[]) { int i; -#ifdef HAVE_AMD_ +#ifdef PSB_HAVE_AMD i= amd_order(n,Ap,Ai, P,(double *)NULL, (double *)NULL); if ((i==AMD_OK)||(i==AMD_OK_BUT_JUMBLED)) return(0); #endif diff --git a/util/psb_c_renum_impl.F90 b/util/psb_c_renum_impl.F90 index f57003a1..9b342d6b 100644 --- a/util/psb_c_renum_impl.F90 +++ b/util/psb_c_renum_impl.F90 @@ -188,7 +188,7 @@ contains subroutine psb_mat_renum_amd(a,info,operm) -#if defined(HAVE_AMD) +#if defined(PSB_HAVE_AMD) use iso_c_binding #endif use psb_base_mod @@ -198,7 +198,7 @@ contains integer(psb_ipk_), allocatable, optional, intent(out) :: operm(:) ! -#if defined(HAVE_AMD) +#if defined(PSB_HAVE_AMD) interface function psb_amd_order(n,ap,ai,p)& & result(res) bind(c,name='psb_amd_order') @@ -223,7 +223,7 @@ contains name = 'mat_renum_amd' call psb_erractionsave(err_act) -#if defined(HAVE_AMD) && defined(IPK4) +#if defined(PSB_HAVE_AMD) && defined(PSB_IPK4) info = psb_success_ nr = a%get_nrows() @@ -451,7 +451,7 @@ contains subroutine psb_lmat_renum_amd(a,info,operm) -#if defined(HAVE_AMD) +#if defined(PSB_HAVE_AMD) use iso_c_binding #endif use psb_base_mod @@ -461,7 +461,7 @@ contains integer(psb_lpk_), allocatable, optional, intent(out) :: operm(:) ! -#if defined(HAVE_AMD) +#if defined(PSB_HAVE_AMD) interface function psb_amd_order(n,ap,ai,p)& & result(res) bind(c,name='psb_amd_order') @@ -486,7 +486,7 @@ contains name = 'mat_renum_amd' call psb_erractionsave(err_act) -#if defined(HAVE_AMD) && defined(LPK4) +#if defined(PSB_HAVE_AMD) && defined(PSB_LPK4) info = psb_success_ nr = a%get_nrows() diff --git a/util/psb_d_renum_impl.F90 b/util/psb_d_renum_impl.F90 index 1c7928f5..08999fc9 100644 --- a/util/psb_d_renum_impl.F90 +++ b/util/psb_d_renum_impl.F90 @@ -188,7 +188,7 @@ contains subroutine psb_mat_renum_amd(a,info,operm) -#if defined(HAVE_AMD) +#if defined(PSB_HAVE_AMD) use iso_c_binding #endif use psb_base_mod @@ -198,7 +198,7 @@ contains integer(psb_ipk_), allocatable, optional, intent(out) :: operm(:) ! -#if defined(HAVE_AMD) +#if defined(PSB_HAVE_AMD) interface function psb_amd_order(n,ap,ai,p)& & result(res) bind(c,name='psb_amd_order') @@ -223,7 +223,7 @@ contains name = 'mat_renum_amd' call psb_erractionsave(err_act) -#if defined(HAVE_AMD) && defined(IPK4) +#if defined(PSB_HAVE_AMD) && defined(PSB_IPK4) info = psb_success_ nr = a%get_nrows() @@ -451,7 +451,7 @@ contains subroutine psb_lmat_renum_amd(a,info,operm) -#if defined(HAVE_AMD) +#if defined(PSB_HAVE_AMD) use iso_c_binding #endif use psb_base_mod @@ -461,7 +461,7 @@ contains integer(psb_lpk_), allocatable, optional, intent(out) :: operm(:) ! -#if defined(HAVE_AMD) +#if defined(PSB_HAVE_AMD) interface function psb_amd_order(n,ap,ai,p)& & result(res) bind(c,name='psb_amd_order') @@ -486,7 +486,7 @@ contains name = 'mat_renum_amd' call psb_erractionsave(err_act) -#if defined(HAVE_AMD) && defined(LPK4) +#if defined(PSB_HAVE_AMD) && defined(PSB_LPK4) info = psb_success_ nr = a%get_nrows() diff --git a/util/psb_i_mmio_impl.F90 b/util/psb_i_mmio_impl.F90 index b8a47eb9..c1998997 100644 --- a/util/psb_i_mmio_impl.F90 +++ b/util/psb_i_mmio_impl.F90 @@ -284,7 +284,7 @@ subroutine mm_ivet1_write(b, header, info, iunit, filename) end subroutine mm_ivet1_write -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine mm_lvet_read(b, info, iunit, filename) use psb_base_mod implicit none diff --git a/util/psb_metis_int.c b/util/psb_metis_int.c index dbf7afb6..4ecc55f6 100644 --- a/util/psb_metis_int.c +++ b/util/psb_metis_int.c @@ -1,8 +1,8 @@ #include #include "psb_metis_int.h" -#if defined(HAVE_METIS) +#if defined(PSB_HAVE_METIS) -#if defined(METIS_REAL_32) +#if defined(PSB_METIS_REAL_32) int metis_PartGraphKway_C(idx_t *n, idx_t *ixadj, idx_t *iadj, idx_t *ivwg, idx_t *iajw, idx_t *nparts, float *weights, @@ -36,7 +36,7 @@ int metis_PartGraphKway_C(idx_t *n, idx_t *ixadj, idx_t *iadj, idx_t *ivwg, } } -#elif defined(METIS_REAL_64) +#elif defined(PSB_METIS_REAL_64) int metis_PartGraphKway_C(idx_t *n, idx_t *ixadj, idx_t *iadj, idx_t *ivwg, idx_t *iajw, idx_t *nparts, double *weights, diff --git a/util/psb_metis_int.h.in b/util/psb_metis_int.h.in index 5914943d..c13ffd2c 100644 --- a/util/psb_metis_int.h.in +++ b/util/psb_metis_int.h.in @@ -1,26 +1,7 @@ #include #include #include "psb_config.h" +#if defined(PSB_HAVE_METIS) #include "@METISINCFILE@" - -#if 0 -typedef int32_t psb_m_t; - -#if defined(IPK4) && defined(LPK4) -typedef int32_t psb_i_t; -typedef int32_t psb_l_t; -#elif defined(IPK4) && defined(LPK8) -typedef int32_t psb_i_t; -typedef int64_t psb_l_t; -#elif defined(IPK8) && defined(LPK8) -typedef int64_t psb_i_t; -typedef int64_t psb_l_t; -#else #endif -typedef int64_t psb_e_t; -typedef float psb_s_t; -typedef double psb_d_t; -typedef float complex psb_c_t; -typedef double complex psb_z_t; -#endif diff --git a/util/psb_metispart_mod.F90 b/util/psb_metispart_mod.F90 index 69dae5a8..4d6c1226 100644 --- a/util/psb_metispart_mod.F90 +++ b/util/psb_metispart_mod.F90 @@ -77,9 +77,9 @@ module psb_metispart_mod integer(psb_lpk_), intent(in) :: n, nparts integer(psb_lpk_), intent(in) :: ja(:), irp(:) integer(psb_lpk_), allocatable, intent(inout) :: vect(:) -#if defined(METIS_REAL_32) || !defined(HAVE_METIS) +#if defined(PSB_METIS_REAL_32) || !defined(PSB_HAVE_METIS) real(psb_spk_),optional, intent(in) :: weights(:) -#elif defined(METIS_REAL_64) +#elif defined(PSB_METIS_REAL_64) real(psb_dpk_),optional, intent(in) :: weights(:) #else choke on me; @@ -187,9 +187,9 @@ contains type(psb_ld_csr_sparse_mat), intent(in) :: a integer(psb_lpk_) :: nparts real(psb_dpk_), optional :: weights(:) -#if defined(METIS_REAL_32) || !defined(HAVE_METIS) +#if defined(PSB_METIS_REAL_32) || !defined(PSB_HAVE_METIS) real(psb_spk_), allocatable :: wgh_(:) -#elif defined(METIS_REAL_64) +#elif defined(PSB_METIS_REAL_64) real(psb_dpk_), allocatable :: wgh_(:) #else choke on me; @@ -231,9 +231,9 @@ contains type(psb_lz_csr_sparse_mat), intent(in) :: a integer(psb_lpk_) :: nparts real(psb_dpk_), optional :: weights(:) -#if defined(METIS_REAL_32) || !defined(HAVE_METIS) +#if defined(PSB_METIS_REAL_32) || !defined(PSB_HAVE_METIS) real(psb_spk_), allocatable :: wgh_(:) -#elif defined(METIS_REAL_64) +#elif defined(PSB_METIS_REAL_64) real(psb_dpk_), allocatable :: wgh_(:) #else choke on me; @@ -292,9 +292,9 @@ contains type(psb_lc_csr_sparse_mat), intent(in) :: a integer(psb_lpk_) :: nparts real(psb_spk_), optional :: weights(:) -#if defined(METIS_REAL_32) || !defined(HAVE_METIS) +#if defined(PSB_METIS_REAL_32) || !defined(PSB_HAVE_METIS) real(psb_spk_), allocatable :: wgh_(:) -#elif defined(METIS_REAL_64) +#elif defined(PSB_METIS_REAL_64) real(psb_dpk_), allocatable :: wgh_(:) #else choke on me; @@ -320,9 +320,9 @@ contains type(psb_ls_csr_sparse_mat), intent(in) :: a integer(psb_lpk_) :: nparts real(psb_spk_), optional :: weights(:) -#if defined(METIS_REAL_32) || !defined(HAVE_METIS) +#if defined(PSB_METIS_REAL_32) || !defined(PSB_HAVE_METIS) real(psb_spk_), allocatable :: wgh_(:) -#elif defined(METIS_REAL_64) +#elif defined(PSB_METIS_REAL_64) real(psb_dpk_), allocatable :: wgh_(:) #else choke on me; diff --git a/util/psb_mmio_mod.F90 b/util/psb_mmio_mod.F90 index f5d45120..533312bb 100644 --- a/util/psb_mmio_mod.F90 +++ b/util/psb_mmio_mod.F90 @@ -42,7 +42,7 @@ module psb_mmio_mod public mm_mat_read, mm_mat_write, mm_array_read, mm_array_write -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) public mm_vet_read, mm_vet_write #endif @@ -127,7 +127,7 @@ module psb_mmio_mod integer(psb_ipk_), optional, intent(in) :: iunit character(len=*), optional, intent(in) :: filename end subroutine mm_ivet2_read -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine mm_lvet_read(b, info, iunit, filename) import :: psb_dpk_, psb_ipk_, psb_lpk_ implicit none @@ -196,7 +196,7 @@ module psb_mmio_mod end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface mm_vet_read procedure mm_svet_read, mm_dvet_read, mm_cvet_read,& & mm_zvet_read, mm_svet2_read, mm_dvet2_read, & @@ -296,7 +296,7 @@ module psb_mmio_mod integer(psb_ipk_), optional, intent(in) :: iunit character(len=*), optional, intent(in) :: filename end subroutine mm_ivet1_write -#if defined(IPK4) && defined(LPK8) +#if defined(PSB_IPK4) && defined(PSB_LPK8) subroutine mm_lvet2_write(b, header, info, iunit, filename) import :: psb_dpk_, psb_ipk_, psb_lpk_ implicit none @@ -372,7 +372,7 @@ module psb_mmio_mod end subroutine mm_lvect_write end interface -#if ! defined(HAVE_BUGGY_GENERICS) +#if ! defined(PSB_HAVE_BUGGY_GENERICS) interface mm_vet_write procedure mm_svet1_write, mm_dvet1_write, mm_cvet1_write,& & mm_zvet1_write, mm_svet2_write, mm_dvet2_write, & diff --git a/util/psb_s_renum_impl.F90 b/util/psb_s_renum_impl.F90 index 6bb37a3c..f60e33a8 100644 --- a/util/psb_s_renum_impl.F90 +++ b/util/psb_s_renum_impl.F90 @@ -188,7 +188,7 @@ contains subroutine psb_mat_renum_amd(a,info,operm) -#if defined(HAVE_AMD) +#if defined(PSB_HAVE_AMD) use iso_c_binding #endif use psb_base_mod @@ -198,7 +198,7 @@ contains integer(psb_ipk_), allocatable, optional, intent(out) :: operm(:) ! -#if defined(HAVE_AMD) +#if defined(PSB_HAVE_AMD) interface function psb_amd_order(n,ap,ai,p)& & result(res) bind(c,name='psb_amd_order') @@ -223,7 +223,7 @@ contains name = 'mat_renum_amd' call psb_erractionsave(err_act) -#if defined(HAVE_AMD) && defined(IPK4) +#if defined(PSB_HAVE_AMD) && defined(PSB_IPK4) info = psb_success_ nr = a%get_nrows() @@ -451,7 +451,7 @@ contains subroutine psb_lmat_renum_amd(a,info,operm) -#if defined(HAVE_AMD) +#if defined(PSB_HAVE_AMD) use iso_c_binding #endif use psb_base_mod @@ -461,7 +461,7 @@ contains integer(psb_lpk_), allocatable, optional, intent(out) :: operm(:) ! -#if defined(HAVE_AMD) +#if defined(PSB_HAVE_AMD) interface function psb_amd_order(n,ap,ai,p)& & result(res) bind(c,name='psb_amd_order') @@ -486,7 +486,7 @@ contains name = 'mat_renum_amd' call psb_erractionsave(err_act) -#if defined(HAVE_AMD) && defined(LPK4) +#if defined(PSB_HAVE_AMD) && defined(PSB_LPK4) info = psb_success_ nr = a%get_nrows() diff --git a/util/psb_z_renum_impl.F90 b/util/psb_z_renum_impl.F90 index a27d4523..ac6517fe 100644 --- a/util/psb_z_renum_impl.F90 +++ b/util/psb_z_renum_impl.F90 @@ -188,7 +188,7 @@ contains subroutine psb_mat_renum_amd(a,info,operm) -#if defined(HAVE_AMD) +#if defined(PSB_HAVE_AMD) use iso_c_binding #endif use psb_base_mod @@ -198,7 +198,7 @@ contains integer(psb_ipk_), allocatable, optional, intent(out) :: operm(:) ! -#if defined(HAVE_AMD) +#if defined(PSB_HAVE_AMD) interface function psb_amd_order(n,ap,ai,p)& & result(res) bind(c,name='psb_amd_order') @@ -223,7 +223,7 @@ contains name = 'mat_renum_amd' call psb_erractionsave(err_act) -#if defined(HAVE_AMD) && defined(IPK4) +#if defined(PSB_HAVE_AMD) && defined(PSB_IPK4) info = psb_success_ nr = a%get_nrows() @@ -451,7 +451,7 @@ contains subroutine psb_lmat_renum_amd(a,info,operm) -#if defined(HAVE_AMD) +#if defined(PSB_HAVE_AMD) use iso_c_binding #endif use psb_base_mod @@ -461,7 +461,7 @@ contains integer(psb_lpk_), allocatable, optional, intent(out) :: operm(:) ! -#if defined(HAVE_AMD) +#if defined(PSB_HAVE_AMD) interface function psb_amd_order(n,ap,ai,p)& & result(res) bind(c,name='psb_amd_order') @@ -486,7 +486,7 @@ contains name = 'mat_renum_amd' call psb_erractionsave(err_act) -#if defined(HAVE_AMD) && defined(LPK4) +#if defined(PSB_HAVE_AMD) && defined(PSB_LPK4) info = psb_success_ nr = a%get_nrows() diff --git a/util/psi_build_mtpart.F90 b/util/psi_build_mtpart.F90 index 02e2b4da..c9bd91b5 100644 --- a/util/psi_build_mtpart.F90 +++ b/util/psi_build_mtpart.F90 @@ -12,28 +12,28 @@ subroutine psi_l_build_mtpart(n,ja,irp,nparts,graph_vect,weights) integer(psb_ipk_) :: info integer(psb_lpk_) :: nl,nptl integer(psb_lpk_), allocatable :: irpl(:),jal(:),gvl(:) -#if defined(METIS_REAL_32) +#if defined(PSB_METIS_REAL_32) real(psb_spk_),allocatable :: wgh_(:) -#elif defined(METIS_REAL_64) +#elif defined(PSB_METIS_REAL_64) real(psb_dpk_),allocatable :: wgh_(:) #endif -#if defined(HAVE_METIS) && defined(LPK4) && defined(METIS_32) +#if defined(PSB_HAVE_METIS) && defined(PSB_LPK4) && defined(PSB_METIS_32) interface - function METIS_PartGraphKway(n,ixadj,iadj,ivwg,iajw,& + function PSB_METIS_PartGraphKway(n,ixadj,iadj,ivwg,iajw,& & nparts,weights,part) bind(c,name="metis_PartGraphKway_C") result(res) use iso_c_binding integer(c_int) :: res integer(c_int) :: n,nparts integer(c_int) :: ixadj(*),iadj(*),ivwg(*),iajw(*),part(*) -#if defined(METIS_REAL_32) +#if defined(PSB_METIS_REAL_32) real(c_float) :: weights(*) -#elif defined(METIS_REAL_64) +#elif defined(PSB_METIS_REAL_64) real(c_double) :: weights(*) #endif !integer(psb_ipk_) :: n,wgflag,numflag,nparts,nedc !integer(psb_ipk_) :: ixadj(*),iadj(*),ivwg(*),iajw(*),iopt(*),part(*) - end function METIS_PartGraphKway + end function PSB_METIS_PartGraphKway end interface call psb_realloc(n,graph_vect,info) @@ -60,19 +60,19 @@ subroutine psi_l_build_mtpart(n,ja,irp,nparts,graph_vect,weights) if (size(weights) == nptl) then wgh_(:) = weights(:) !!$ write(*,*) 'weights present',weights -!!$ ! call METIS_PartGraphKway(n,irp,ja,idummy,jdummy,& +!!$ ! call PSB_METIS_PartGraphKway(n,irp,ja,idummy,jdummy,& !!$ ! & wgflag,numflag,nparts,weights,iopt,nedc,graph_vect) -!!$ info = METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& +!!$ info = PSB_METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& !!$ & nptl,weights,gvl) !!$ else write(*,*) 'weights absent',wgh_ -!!$ info = METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& +!!$ info = PSB_METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& !!$ & nptl,wgh_,gvl) end if endif !!$ write(*,*) 'weights absent',wgh_ - info = METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& + info = PSB_METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& & nptl,wgh_,gvl) !!$ write(*,*) 'after allocation',info @@ -85,23 +85,23 @@ subroutine psi_l_build_mtpart(n,ja,irp,nparts,graph_vect,weights) enddo endif -#elif defined(HAVE_METIS) && defined(LPK8) && defined(METIS_64) +#elif defined(PSB_HAVE_METIS) && defined(PSB_LPK8) && defined(PSB_METIS_64) interface - function METIS_PartGraphKway(n,ixadj,iadj,ivwg,iajw,& + function PSB_METIS_PartGraphKway(n,ixadj,iadj,ivwg,iajw,& & nparts,weights,part) bind(c,name="metis_PartGraphKway_C") result(res) use iso_c_binding integer(c_long_long) :: res integer(c_long_long) :: n,nparts integer(c_long_long) :: ixadj(*),iadj(*),ivwg(*),iajw(*),part(*) -#if defined(METIS_REAL_32) +#if defined(PSB_METIS_REAL_32) real(c_float) :: weights(*) -#elif defined(METIS_REAL_64) +#elif defined(PSB_METIS_REAL_64) real(c_double) :: weights(*) #endif !integer(psb_ipk_) :: n,wgflag,numflag,nparts,nedc !integer(psb_ipk_) :: ixadj(*),iadj(*),ivwg(*),iajw(*),iopt(*),part(*) - end function METIS_PartGraphKway + end function PSB_METIS_PartGraphKway end interface call psb_realloc(n,graph_vect,info) @@ -128,37 +128,37 @@ subroutine psi_l_build_mtpart(n,ja,irp,nparts,graph_vect,weights) if (size(weights) == nptl) then wgh_(:) = weights(:) !!$ write(*,*) 'weights present',weights -!!$ ! call METIS_PartGraphKway(n,irp,ja,idummy,jdummy,& +!!$ ! call PSB_METIS_PartGraphKway(n,irp,ja,idummy,jdummy,& !!$ ! & wgflag,numflag,nparts,weights,iopt,nedc,graph_vect) -!!$ info = METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& +!!$ info = PSB_METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& !!$ & nptl,weights,gvl) !!$ else write(*,*) 'weights absent',wgh_ -!!$ info = METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& +!!$ info = PSB_METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& !!$ & nptl,wgh_,gvl) end if endif !!$ write(*,*) 'weights absent',wgh_ - info = METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& + info = PSB_METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& & nptl,wgh_,gvl) #if 0 if(present(weights)) then if (size(weights) == nptl) then !!$ write(*,*) 'weights present',weights - ! call METIS_PartGraphKway(n,irp,ja,idummy,jdummy,& + ! call PSB_METIS_PartGraphKway(n,irp,ja,idummy,jdummy,& ! & wgflag,numflag,nparts,weights,iopt,nedc,graph_vect) - info = METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& + info = PSB_METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& & nptl,weights,gvl) else !!$ write(*,*) 'weights absent',wgh_ - info = METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& + info = PSB_METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& & nptl,wgh_,gvl) end if else !!$ write(*,*) 'weights absent',wgh_ - info = METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& + info = PSB_METIS_PartGraphKway(nl,irpl,jal,idummy,jdummy,& & nptl,wgh_,gvl) endif !!$ write(*,*) 'after allocation',info @@ -174,7 +174,7 @@ subroutine psi_l_build_mtpart(n,ja,irp,nparts,graph_vect,weights) #else - write(psb_err_unit,*) 'Warning: no suitable METIS interface for LPK indices' + write(psb_err_unit,*) 'Warning: no suitable METIS interface for PSB_LPK indices' #endif return From f112e42deb672a6f227a85ea314fed0539b9c85b Mon Sep 17 00:00:00 2001 From: sfilippone Date: Fri, 14 Mar 2025 18:49:10 +0100 Subject: [PATCH 02/20] Main Makefile fixes --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index dc0685be..34550195 100644 --- a/Makefile +++ b/Makefile @@ -84,8 +84,7 @@ cleanlib: (cd modules; /bin/rm -f *.a *$(.mod) *$(.fh) *.h) distclean: clean - /bin/rm -f Make.inc util/psb_metis_int.h base/modules/psb_config.h \ - base/modules/psb_cxxconfig.h + /bin/rm -f Make.inc util/psb_metis_int.h base/modules/psb_config.h check: all make check -C test/serial From fb046a6a6dc6fcf5843928d84a53330f17143e81 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Fri, 14 Mar 2025 19:17:28 +0100 Subject: [PATCH 03/20] Fix METIS_LIB --- configure | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 620705b1..7ea6582e 100755 --- a/configure +++ b/configure @@ -11125,7 +11125,7 @@ UTILLIBNAME=libpsb_util.a PSBLASRULES=' -PSBLDLIBS=$(LAPACK) $(BLAS) $(PSB_METIS_LIB) $(AMD_LIB) $(FLIBS) $(LIBS) +PSBLDLIBS=$(LAPACK) $(BLAS) $(METIS_LIB) $(AMD_LIB) $(FLIBS) $(LIBS) CXXDEFINES=$(PSBCXXDEFINES) CDEFINES=$(PSBCDEFINES) FDEFINES=$(PSBFDEFINES) diff --git a/configure.ac b/configure.ac index df1d23f6..d30c33f1 100644 --- a/configure.ac +++ b/configure.ac @@ -1011,7 +1011,7 @@ AC_SUBST(CINCLUDES) AC_SUBST(FINCLUDES) PSBLASRULES=' -PSBLDLIBS=$(LAPACK) $(BLAS) $(PSB_METIS_LIB) $(AMD_LIB) $(FLIBS) $(LIBS) +PSBLDLIBS=$(LAPACK) $(BLAS) $(METIS_LIB) $(AMD_LIB) $(FLIBS) $(LIBS) CXXDEFINES=$(PSBCXXDEFINES) CDEFINES=$(PSBCDEFINES) FDEFINES=$(PSBFDEFINES) From e1ae3df6a3e7f57f9d3bed8700b16d74be11b4a0 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Mon, 17 Mar 2025 10:48:09 +0100 Subject: [PATCH 04/20] Fix internal names in fakempi.h --- base/modules/psb_fakempi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/modules/psb_fakempi.h b/base/modules/psb_fakempi.h index 61e7fa82..27973fbd 100644 --- a/base/modules/psb_fakempi.h +++ b/base/modules/psb_fakempi.h @@ -1,5 +1,5 @@ -#ifndef PSB_INTERNALS_H -#define PSB_INTERNALS_H +#ifndef PSB_FAKEMPI_H +#define PSB_FAKEMPI_H #include "psb_config.h" #define MPI_INTEGER 1 From c7d414776980d5a175866fc86531a922a4735456 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Mon, 17 Mar 2025 10:48:32 +0100 Subject: [PATCH 05/20] Fix bug in triad apparently caused by target attribute --- base/modules/penv/psi_c_collective_mod.F90 | 40 ++++++++++----------- base/modules/penv/psi_d_collective_mod.F90 | 40 ++++++++++----------- base/modules/penv/psi_e_collective_mod.F90 | 40 ++++++++++----------- base/modules/penv/psi_i2_collective_mod.F90 | 40 ++++++++++----------- base/modules/penv/psi_m_collective_mod.F90 | 40 ++++++++++----------- base/modules/penv/psi_s_collective_mod.F90 | 40 ++++++++++----------- base/modules/penv/psi_z_collective_mod.F90 | 40 ++++++++++----------- 7 files changed, 140 insertions(+), 140 deletions(-) diff --git a/base/modules/penv/psi_c_collective_mod.F90 b/base/modules/penv/psi_c_collective_mod.F90 index a05addf4..6457e81e 100644 --- a/base/modules/penv/psi_c_collective_mod.F90 +++ b/base/modules/penv/psi_c_collective_mod.F90 @@ -1464,10 +1464,10 @@ contains #ifdef PSB_MPI_H include 'mpif.h' #endif - complex(psb_spk_), intent(in), target :: valsnd(:) - integer(psb_mpk_), intent(in), target :: iasnd(:), jasnd(:) - complex(psb_spk_), intent(out), target :: valrcv(:) - integer(psb_mpk_), intent(out),target :: iarcv(:), jarcv(:) + complex(psb_spk_), intent(in) :: valsnd(:) + integer(psb_mpk_), intent(in) :: iasnd(:), jasnd(:) + complex(psb_spk_), intent(out) :: valrcv(:) + integer(psb_mpk_), intent(out) :: iarcv(:), jarcv(:) integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) type(psb_ctxt_type), intent(in) :: ctxt integer(psb_ipk_), intent(out) :: info @@ -1494,14 +1494,14 @@ contains prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = brvindx(ip+1) p2ptag = psb_complex_tag - call mpi_irecv((valrcv(idx+1:idx+sz)),sz,& + call mpi_irecv(valrcv(idx+1:idx+sz),sz,& & psb_mpi_c_spk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,1),iret) p2ptag = psb_int_swap_tag - call mpi_irecv((iarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(iarcv(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,2),iret) - call mpi_irecv((jarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(jarcv(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,3),iret) end if @@ -1514,14 +1514,14 @@ contains if (prcid(ip+1)<0) prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = bsdindx(ip+1) p2ptag = psb_complex_tag - call mpi_send((valsnd(idx+1:idx+sz)),sz,& + call mpi_send(valsnd(idx+1:idx+sz),sz,& & psb_mpi_c_spk_,prcid(ip+1),& & p2ptag, icomm,iret) p2ptag = psb_int_swap_tag - call mpi_send((iasnd(idx+1:idx+sz)),sz,& + call mpi_send(iasnd(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,iret) - call mpi_send((jasnd(idx+1:idx+sz)),sz,& + call mpi_send(jasnd(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,iret) end if @@ -1547,10 +1547,10 @@ contains #ifdef PSB_MPI_H include 'mpif.h' #endif - complex(psb_spk_), intent(in), target :: valsnd(:) - integer(psb_epk_), intent(in), target :: iasnd(:), jasnd(:) - complex(psb_spk_), intent(out), target :: valrcv(:) - integer(psb_epk_), intent(out), target :: iarcv(:), jarcv(:) + complex(psb_spk_), intent(in) :: valsnd(:) + integer(psb_epk_), intent(in) :: iasnd(:), jasnd(:) + complex(psb_spk_), intent(out) :: valrcv(:) + integer(psb_epk_), intent(out) :: iarcv(:), jarcv(:) integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) type(psb_ctxt_type), intent(in) :: ctxt integer(psb_ipk_), intent(out) :: info @@ -1577,14 +1577,14 @@ contains prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = brvindx(ip+1) p2ptag = psb_complex_tag - call mpi_irecv((valrcv(idx+1:idx+sz)),sz,& + call mpi_irecv(valrcv(idx+1:idx+sz),sz,& & psb_mpi_c_spk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,1),iret) p2ptag = psb_int_swap_tag - call mpi_irecv((iarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(iarcv(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,2),iret) - call mpi_irecv((jarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(jarcv(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,3),iret) end if @@ -1597,14 +1597,14 @@ contains if (prcid(ip+1)<0) prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = bsdindx(ip+1) p2ptag = psb_complex_tag - call mpi_send((valsnd(idx+1:idx+sz)),sz,& + call mpi_send(valsnd(idx+1:idx+sz),sz,& & psb_mpi_c_spk_,prcid(ip+1),& & p2ptag, icomm,iret) p2ptag = psb_int_swap_tag - call mpi_send((iasnd(idx+1:idx+sz)),sz,& + call mpi_send(iasnd(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,iret) - call mpi_send((jasnd(idx+1:idx+sz)),sz,& + call mpi_send(jasnd(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,iret) end if diff --git a/base/modules/penv/psi_d_collective_mod.F90 b/base/modules/penv/psi_d_collective_mod.F90 index 9bd392ef..7a0e7d9e 100644 --- a/base/modules/penv/psi_d_collective_mod.F90 +++ b/base/modules/penv/psi_d_collective_mod.F90 @@ -2104,10 +2104,10 @@ contains #ifdef PSB_MPI_H include 'mpif.h' #endif - real(psb_dpk_), intent(in), target :: valsnd(:) - integer(psb_mpk_), intent(in), target :: iasnd(:), jasnd(:) - real(psb_dpk_), intent(out), target :: valrcv(:) - integer(psb_mpk_), intent(out),target :: iarcv(:), jarcv(:) + real(psb_dpk_), intent(in) :: valsnd(:) + integer(psb_mpk_), intent(in) :: iasnd(:), jasnd(:) + real(psb_dpk_), intent(out) :: valrcv(:) + integer(psb_mpk_), intent(out) :: iarcv(:), jarcv(:) integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) type(psb_ctxt_type), intent(in) :: ctxt integer(psb_ipk_), intent(out) :: info @@ -2134,14 +2134,14 @@ contains prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = brvindx(ip+1) p2ptag = psb_double_tag - call mpi_irecv((valrcv(idx+1:idx+sz)),sz,& + call mpi_irecv(valrcv(idx+1:idx+sz),sz,& & psb_mpi_r_dpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,1),iret) p2ptag = psb_int_swap_tag - call mpi_irecv((iarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(iarcv(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,2),iret) - call mpi_irecv((jarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(jarcv(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,3),iret) end if @@ -2154,14 +2154,14 @@ contains if (prcid(ip+1)<0) prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = bsdindx(ip+1) p2ptag = psb_double_tag - call mpi_send((valsnd(idx+1:idx+sz)),sz,& + call mpi_send(valsnd(idx+1:idx+sz),sz,& & psb_mpi_r_dpk_,prcid(ip+1),& & p2ptag, icomm,iret) p2ptag = psb_int_swap_tag - call mpi_send((iasnd(idx+1:idx+sz)),sz,& + call mpi_send(iasnd(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,iret) - call mpi_send((jasnd(idx+1:idx+sz)),sz,& + call mpi_send(jasnd(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,iret) end if @@ -2187,10 +2187,10 @@ contains #ifdef PSB_MPI_H include 'mpif.h' #endif - real(psb_dpk_), intent(in), target :: valsnd(:) - integer(psb_epk_), intent(in), target :: iasnd(:), jasnd(:) - real(psb_dpk_), intent(out), target :: valrcv(:) - integer(psb_epk_), intent(out), target :: iarcv(:), jarcv(:) + real(psb_dpk_), intent(in) :: valsnd(:) + integer(psb_epk_), intent(in) :: iasnd(:), jasnd(:) + real(psb_dpk_), intent(out) :: valrcv(:) + integer(psb_epk_), intent(out) :: iarcv(:), jarcv(:) integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) type(psb_ctxt_type), intent(in) :: ctxt integer(psb_ipk_), intent(out) :: info @@ -2217,14 +2217,14 @@ contains prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = brvindx(ip+1) p2ptag = psb_double_tag - call mpi_irecv((valrcv(idx+1:idx+sz)),sz,& + call mpi_irecv(valrcv(idx+1:idx+sz),sz,& & psb_mpi_r_dpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,1),iret) p2ptag = psb_int_swap_tag - call mpi_irecv((iarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(iarcv(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,2),iret) - call mpi_irecv((jarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(jarcv(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,3),iret) end if @@ -2237,14 +2237,14 @@ contains if (prcid(ip+1)<0) prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = bsdindx(ip+1) p2ptag = psb_double_tag - call mpi_send((valsnd(idx+1:idx+sz)),sz,& + call mpi_send(valsnd(idx+1:idx+sz),sz,& & psb_mpi_r_dpk_,prcid(ip+1),& & p2ptag, icomm,iret) p2ptag = psb_int_swap_tag - call mpi_send((iasnd(idx+1:idx+sz)),sz,& + call mpi_send(iasnd(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,iret) - call mpi_send((jasnd(idx+1:idx+sz)),sz,& + call mpi_send(jasnd(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,iret) end if diff --git a/base/modules/penv/psi_e_collective_mod.F90 b/base/modules/penv/psi_e_collective_mod.F90 index 8ce5b75a..5a6234d6 100644 --- a/base/modules/penv/psi_e_collective_mod.F90 +++ b/base/modules/penv/psi_e_collective_mod.F90 @@ -1942,10 +1942,10 @@ contains #ifdef PSB_MPI_H include 'mpif.h' #endif - integer(psb_epk_), intent(in), target :: valsnd(:) - integer(psb_mpk_), intent(in), target :: iasnd(:), jasnd(:) - integer(psb_epk_), intent(out), target :: valrcv(:) - integer(psb_mpk_), intent(out),target :: iarcv(:), jarcv(:) + integer(psb_epk_), intent(in) :: valsnd(:) + integer(psb_mpk_), intent(in) :: iasnd(:), jasnd(:) + integer(psb_epk_), intent(out) :: valrcv(:) + integer(psb_mpk_), intent(out) :: iarcv(:), jarcv(:) integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) type(psb_ctxt_type), intent(in) :: ctxt integer(psb_ipk_), intent(out) :: info @@ -1972,14 +1972,14 @@ contains prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = brvindx(ip+1) p2ptag = psb_int8_tag - call mpi_irecv((valrcv(idx+1:idx+sz)),sz,& + call mpi_irecv(valrcv(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,1),iret) p2ptag = psb_int_swap_tag - call mpi_irecv((iarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(iarcv(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,2),iret) - call mpi_irecv((jarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(jarcv(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,3),iret) end if @@ -1992,14 +1992,14 @@ contains if (prcid(ip+1)<0) prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = bsdindx(ip+1) p2ptag = psb_int8_tag - call mpi_send((valsnd(idx+1:idx+sz)),sz,& + call mpi_send(valsnd(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,iret) p2ptag = psb_int_swap_tag - call mpi_send((iasnd(idx+1:idx+sz)),sz,& + call mpi_send(iasnd(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,iret) - call mpi_send((jasnd(idx+1:idx+sz)),sz,& + call mpi_send(jasnd(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,iret) end if @@ -2025,10 +2025,10 @@ contains #ifdef PSB_MPI_H include 'mpif.h' #endif - integer(psb_epk_), intent(in), target :: valsnd(:) - integer(psb_epk_), intent(in), target :: iasnd(:), jasnd(:) - integer(psb_epk_), intent(out), target :: valrcv(:) - integer(psb_epk_), intent(out), target :: iarcv(:), jarcv(:) + integer(psb_epk_), intent(in) :: valsnd(:) + integer(psb_epk_), intent(in) :: iasnd(:), jasnd(:) + integer(psb_epk_), intent(out) :: valrcv(:) + integer(psb_epk_), intent(out) :: iarcv(:), jarcv(:) integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) type(psb_ctxt_type), intent(in) :: ctxt integer(psb_ipk_), intent(out) :: info @@ -2055,14 +2055,14 @@ contains prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = brvindx(ip+1) p2ptag = psb_int8_tag - call mpi_irecv((valrcv(idx+1:idx+sz)),sz,& + call mpi_irecv(valrcv(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,1),iret) p2ptag = psb_int_swap_tag - call mpi_irecv((iarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(iarcv(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,2),iret) - call mpi_irecv((jarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(jarcv(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,3),iret) end if @@ -2075,14 +2075,14 @@ contains if (prcid(ip+1)<0) prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = bsdindx(ip+1) p2ptag = psb_int8_tag - call mpi_send((valsnd(idx+1:idx+sz)),sz,& + call mpi_send(valsnd(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,iret) p2ptag = psb_int_swap_tag - call mpi_send((iasnd(idx+1:idx+sz)),sz,& + call mpi_send(iasnd(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,iret) - call mpi_send((jasnd(idx+1:idx+sz)),sz,& + call mpi_send(jasnd(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,iret) end if diff --git a/base/modules/penv/psi_i2_collective_mod.F90 b/base/modules/penv/psi_i2_collective_mod.F90 index bcecbb8c..7f504b12 100644 --- a/base/modules/penv/psi_i2_collective_mod.F90 +++ b/base/modules/penv/psi_i2_collective_mod.F90 @@ -1942,10 +1942,10 @@ contains #ifdef PSB_MPI_H include 'mpif.h' #endif - integer(psb_i2pk_), intent(in), target :: valsnd(:) - integer(psb_mpk_), intent(in), target :: iasnd(:), jasnd(:) - integer(psb_i2pk_), intent(out), target :: valrcv(:) - integer(psb_mpk_), intent(out),target :: iarcv(:), jarcv(:) + integer(psb_i2pk_), intent(in) :: valsnd(:) + integer(psb_mpk_), intent(in) :: iasnd(:), jasnd(:) + integer(psb_i2pk_), intent(out) :: valrcv(:) + integer(psb_mpk_), intent(out) :: iarcv(:), jarcv(:) integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) type(psb_ctxt_type), intent(in) :: ctxt integer(psb_ipk_), intent(out) :: info @@ -1972,14 +1972,14 @@ contains prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = brvindx(ip+1) p2ptag = psb_int2_tag - call mpi_irecv((valrcv(idx+1:idx+sz)),sz,& + call mpi_irecv(valrcv(idx+1:idx+sz),sz,& & psb_mpi_i2pk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,1),iret) p2ptag = psb_int_swap_tag - call mpi_irecv((iarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(iarcv(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,2),iret) - call mpi_irecv((jarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(jarcv(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,3),iret) end if @@ -1992,14 +1992,14 @@ contains if (prcid(ip+1)<0) prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = bsdindx(ip+1) p2ptag = psb_int2_tag - call mpi_send((valsnd(idx+1:idx+sz)),sz,& + call mpi_send(valsnd(idx+1:idx+sz),sz,& & psb_mpi_i2pk_,prcid(ip+1),& & p2ptag, icomm,iret) p2ptag = psb_int_swap_tag - call mpi_send((iasnd(idx+1:idx+sz)),sz,& + call mpi_send(iasnd(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,iret) - call mpi_send((jasnd(idx+1:idx+sz)),sz,& + call mpi_send(jasnd(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,iret) end if @@ -2025,10 +2025,10 @@ contains #ifdef PSB_MPI_H include 'mpif.h' #endif - integer(psb_i2pk_), intent(in), target :: valsnd(:) - integer(psb_epk_), intent(in), target :: iasnd(:), jasnd(:) - integer(psb_i2pk_), intent(out), target :: valrcv(:) - integer(psb_epk_), intent(out), target :: iarcv(:), jarcv(:) + integer(psb_i2pk_), intent(in) :: valsnd(:) + integer(psb_epk_), intent(in) :: iasnd(:), jasnd(:) + integer(psb_i2pk_), intent(out) :: valrcv(:) + integer(psb_epk_), intent(out) :: iarcv(:), jarcv(:) integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) type(psb_ctxt_type), intent(in) :: ctxt integer(psb_ipk_), intent(out) :: info @@ -2055,14 +2055,14 @@ contains prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = brvindx(ip+1) p2ptag = psb_int2_tag - call mpi_irecv((valrcv(idx+1:idx+sz)),sz,& + call mpi_irecv(valrcv(idx+1:idx+sz),sz,& & psb_mpi_i2pk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,1),iret) p2ptag = psb_int_swap_tag - call mpi_irecv((iarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(iarcv(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,2),iret) - call mpi_irecv((jarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(jarcv(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,3),iret) end if @@ -2075,14 +2075,14 @@ contains if (prcid(ip+1)<0) prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = bsdindx(ip+1) p2ptag = psb_int2_tag - call mpi_send((valsnd(idx+1:idx+sz)),sz,& + call mpi_send(valsnd(idx+1:idx+sz),sz,& & psb_mpi_i2pk_,prcid(ip+1),& & p2ptag, icomm,iret) p2ptag = psb_int_swap_tag - call mpi_send((iasnd(idx+1:idx+sz)),sz,& + call mpi_send(iasnd(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,iret) - call mpi_send((jasnd(idx+1:idx+sz)),sz,& + call mpi_send(jasnd(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,iret) end if diff --git a/base/modules/penv/psi_m_collective_mod.F90 b/base/modules/penv/psi_m_collective_mod.F90 index 2205a1a8..a616587e 100644 --- a/base/modules/penv/psi_m_collective_mod.F90 +++ b/base/modules/penv/psi_m_collective_mod.F90 @@ -1942,10 +1942,10 @@ contains #ifdef PSB_MPI_H include 'mpif.h' #endif - integer(psb_mpk_), intent(in), target :: valsnd(:) - integer(psb_mpk_), intent(in), target :: iasnd(:), jasnd(:) - integer(psb_mpk_), intent(out), target :: valrcv(:) - integer(psb_mpk_), intent(out),target :: iarcv(:), jarcv(:) + integer(psb_mpk_), intent(in) :: valsnd(:) + integer(psb_mpk_), intent(in) :: iasnd(:), jasnd(:) + integer(psb_mpk_), intent(out) :: valrcv(:) + integer(psb_mpk_), intent(out) :: iarcv(:), jarcv(:) integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) type(psb_ctxt_type), intent(in) :: ctxt integer(psb_ipk_), intent(out) :: info @@ -1972,14 +1972,14 @@ contains prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = brvindx(ip+1) p2ptag = psb_int4_tag - call mpi_irecv((valrcv(idx+1:idx+sz)),sz,& + call mpi_irecv(valrcv(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,1),iret) p2ptag = psb_int_swap_tag - call mpi_irecv((iarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(iarcv(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,2),iret) - call mpi_irecv((jarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(jarcv(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,3),iret) end if @@ -1992,14 +1992,14 @@ contains if (prcid(ip+1)<0) prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = bsdindx(ip+1) p2ptag = psb_int4_tag - call mpi_send((valsnd(idx+1:idx+sz)),sz,& + call mpi_send(valsnd(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,iret) p2ptag = psb_int_swap_tag - call mpi_send((iasnd(idx+1:idx+sz)),sz,& + call mpi_send(iasnd(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,iret) - call mpi_send((jasnd(idx+1:idx+sz)),sz,& + call mpi_send(jasnd(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,iret) end if @@ -2025,10 +2025,10 @@ contains #ifdef PSB_MPI_H include 'mpif.h' #endif - integer(psb_mpk_), intent(in), target :: valsnd(:) - integer(psb_epk_), intent(in), target :: iasnd(:), jasnd(:) - integer(psb_mpk_), intent(out), target :: valrcv(:) - integer(psb_epk_), intent(out), target :: iarcv(:), jarcv(:) + integer(psb_mpk_), intent(in) :: valsnd(:) + integer(psb_epk_), intent(in) :: iasnd(:), jasnd(:) + integer(psb_mpk_), intent(out) :: valrcv(:) + integer(psb_epk_), intent(out) :: iarcv(:), jarcv(:) integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) type(psb_ctxt_type), intent(in) :: ctxt integer(psb_ipk_), intent(out) :: info @@ -2055,14 +2055,14 @@ contains prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = brvindx(ip+1) p2ptag = psb_int4_tag - call mpi_irecv((valrcv(idx+1:idx+sz)),sz,& + call mpi_irecv(valrcv(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,1),iret) p2ptag = psb_int_swap_tag - call mpi_irecv((iarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(iarcv(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,2),iret) - call mpi_irecv((jarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(jarcv(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,3),iret) end if @@ -2075,14 +2075,14 @@ contains if (prcid(ip+1)<0) prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = bsdindx(ip+1) p2ptag = psb_int4_tag - call mpi_send((valsnd(idx+1:idx+sz)),sz,& + call mpi_send(valsnd(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,iret) p2ptag = psb_int_swap_tag - call mpi_send((iasnd(idx+1:idx+sz)),sz,& + call mpi_send(iasnd(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,iret) - call mpi_send((jasnd(idx+1:idx+sz)),sz,& + call mpi_send(jasnd(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,iret) end if diff --git a/base/modules/penv/psi_s_collective_mod.F90 b/base/modules/penv/psi_s_collective_mod.F90 index 4eab51ce..01e50408 100644 --- a/base/modules/penv/psi_s_collective_mod.F90 +++ b/base/modules/penv/psi_s_collective_mod.F90 @@ -2104,10 +2104,10 @@ contains #ifdef PSB_MPI_H include 'mpif.h' #endif - real(psb_spk_), intent(in), target :: valsnd(:) - integer(psb_mpk_), intent(in), target :: iasnd(:), jasnd(:) - real(psb_spk_), intent(out), target :: valrcv(:) - integer(psb_mpk_), intent(out),target :: iarcv(:), jarcv(:) + real(psb_spk_), intent(in) :: valsnd(:) + integer(psb_mpk_), intent(in) :: iasnd(:), jasnd(:) + real(psb_spk_), intent(out) :: valrcv(:) + integer(psb_mpk_), intent(out) :: iarcv(:), jarcv(:) integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) type(psb_ctxt_type), intent(in) :: ctxt integer(psb_ipk_), intent(out) :: info @@ -2134,14 +2134,14 @@ contains prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = brvindx(ip+1) p2ptag = psb_real_tag - call mpi_irecv((valrcv(idx+1:idx+sz)),sz,& + call mpi_irecv(valrcv(idx+1:idx+sz),sz,& & psb_mpi_r_spk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,1),iret) p2ptag = psb_int_swap_tag - call mpi_irecv((iarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(iarcv(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,2),iret) - call mpi_irecv((jarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(jarcv(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,3),iret) end if @@ -2154,14 +2154,14 @@ contains if (prcid(ip+1)<0) prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = bsdindx(ip+1) p2ptag = psb_real_tag - call mpi_send((valsnd(idx+1:idx+sz)),sz,& + call mpi_send(valsnd(idx+1:idx+sz),sz,& & psb_mpi_r_spk_,prcid(ip+1),& & p2ptag, icomm,iret) p2ptag = psb_int_swap_tag - call mpi_send((iasnd(idx+1:idx+sz)),sz,& + call mpi_send(iasnd(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,iret) - call mpi_send((jasnd(idx+1:idx+sz)),sz,& + call mpi_send(jasnd(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,iret) end if @@ -2187,10 +2187,10 @@ contains #ifdef PSB_MPI_H include 'mpif.h' #endif - real(psb_spk_), intent(in), target :: valsnd(:) - integer(psb_epk_), intent(in), target :: iasnd(:), jasnd(:) - real(psb_spk_), intent(out), target :: valrcv(:) - integer(psb_epk_), intent(out), target :: iarcv(:), jarcv(:) + real(psb_spk_), intent(in) :: valsnd(:) + integer(psb_epk_), intent(in) :: iasnd(:), jasnd(:) + real(psb_spk_), intent(out) :: valrcv(:) + integer(psb_epk_), intent(out) :: iarcv(:), jarcv(:) integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) type(psb_ctxt_type), intent(in) :: ctxt integer(psb_ipk_), intent(out) :: info @@ -2217,14 +2217,14 @@ contains prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = brvindx(ip+1) p2ptag = psb_real_tag - call mpi_irecv((valrcv(idx+1:idx+sz)),sz,& + call mpi_irecv(valrcv(idx+1:idx+sz),sz,& & psb_mpi_r_spk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,1),iret) p2ptag = psb_int_swap_tag - call mpi_irecv((iarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(iarcv(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,2),iret) - call mpi_irecv((jarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(jarcv(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,3),iret) end if @@ -2237,14 +2237,14 @@ contains if (prcid(ip+1)<0) prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = bsdindx(ip+1) p2ptag = psb_real_tag - call mpi_send((valsnd(idx+1:idx+sz)),sz,& + call mpi_send(valsnd(idx+1:idx+sz),sz,& & psb_mpi_r_spk_,prcid(ip+1),& & p2ptag, icomm,iret) p2ptag = psb_int_swap_tag - call mpi_send((iasnd(idx+1:idx+sz)),sz,& + call mpi_send(iasnd(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,iret) - call mpi_send((jasnd(idx+1:idx+sz)),sz,& + call mpi_send(jasnd(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,iret) end if diff --git a/base/modules/penv/psi_z_collective_mod.F90 b/base/modules/penv/psi_z_collective_mod.F90 index fe398c2b..d4ef2802 100644 --- a/base/modules/penv/psi_z_collective_mod.F90 +++ b/base/modules/penv/psi_z_collective_mod.F90 @@ -1464,10 +1464,10 @@ contains #ifdef PSB_MPI_H include 'mpif.h' #endif - complex(psb_dpk_), intent(in), target :: valsnd(:) - integer(psb_mpk_), intent(in), target :: iasnd(:), jasnd(:) - complex(psb_dpk_), intent(out), target :: valrcv(:) - integer(psb_mpk_), intent(out),target :: iarcv(:), jarcv(:) + complex(psb_dpk_), intent(in) :: valsnd(:) + integer(psb_mpk_), intent(in) :: iasnd(:), jasnd(:) + complex(psb_dpk_), intent(out) :: valrcv(:) + integer(psb_mpk_), intent(out) :: iarcv(:), jarcv(:) integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) type(psb_ctxt_type), intent(in) :: ctxt integer(psb_ipk_), intent(out) :: info @@ -1494,14 +1494,14 @@ contains prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = brvindx(ip+1) p2ptag = psb_dcomplex_tag - call mpi_irecv((valrcv(idx+1:idx+sz)),sz,& + call mpi_irecv(valrcv(idx+1:idx+sz),sz,& & psb_mpi_c_dpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,1),iret) p2ptag = psb_int_swap_tag - call mpi_irecv((iarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(iarcv(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,2),iret) - call mpi_irecv((jarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(jarcv(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,3),iret) end if @@ -1514,14 +1514,14 @@ contains if (prcid(ip+1)<0) prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = bsdindx(ip+1) p2ptag = psb_dcomplex_tag - call mpi_send((valsnd(idx+1:idx+sz)),sz,& + call mpi_send(valsnd(idx+1:idx+sz),sz,& & psb_mpi_c_dpk_,prcid(ip+1),& & p2ptag, icomm,iret) p2ptag = psb_int_swap_tag - call mpi_send((iasnd(idx+1:idx+sz)),sz,& + call mpi_send(iasnd(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,iret) - call mpi_send((jasnd(idx+1:idx+sz)),sz,& + call mpi_send(jasnd(idx+1:idx+sz),sz,& & psb_mpi_mpk_,prcid(ip+1),& & p2ptag, icomm,iret) end if @@ -1547,10 +1547,10 @@ contains #ifdef PSB_MPI_H include 'mpif.h' #endif - complex(psb_dpk_), intent(in), target :: valsnd(:) - integer(psb_epk_), intent(in), target :: iasnd(:), jasnd(:) - complex(psb_dpk_), intent(out), target :: valrcv(:) - integer(psb_epk_), intent(out), target :: iarcv(:), jarcv(:) + complex(psb_dpk_), intent(in) :: valsnd(:) + integer(psb_epk_), intent(in) :: iasnd(:), jasnd(:) + complex(psb_dpk_), intent(out) :: valrcv(:) + integer(psb_epk_), intent(out) :: iarcv(:), jarcv(:) integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) type(psb_ctxt_type), intent(in) :: ctxt integer(psb_ipk_), intent(out) :: info @@ -1577,14 +1577,14 @@ contains prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = brvindx(ip+1) p2ptag = psb_dcomplex_tag - call mpi_irecv((valrcv(idx+1:idx+sz)),sz,& + call mpi_irecv(valrcv(idx+1:idx+sz),sz,& & psb_mpi_c_dpk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,1),iret) p2ptag = psb_int_swap_tag - call mpi_irecv((iarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(iarcv(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,2),iret) - call mpi_irecv((jarcv(idx+1:idx+sz)),sz,& + call mpi_irecv(jarcv(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,rvhd(ip+1,3),iret) end if @@ -1597,14 +1597,14 @@ contains if (prcid(ip+1)<0) prcid(ip+1) = psb_get_mpi_rank(ctxt,ip) idx = bsdindx(ip+1) p2ptag = psb_dcomplex_tag - call mpi_send((valsnd(idx+1:idx+sz)),sz,& + call mpi_send(valsnd(idx+1:idx+sz),sz,& & psb_mpi_c_dpk_,prcid(ip+1),& & p2ptag, icomm,iret) p2ptag = psb_int_swap_tag - call mpi_send((iasnd(idx+1:idx+sz)),sz,& + call mpi_send(iasnd(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,iret) - call mpi_send((jasnd(idx+1:idx+sz)),sz,& + call mpi_send(jasnd(idx+1:idx+sz),sz,& & psb_mpi_epk_,prcid(ip+1),& & p2ptag, icomm,iret) end if From 243fe4e78f95c3c7e193617f05466017a76da5e9 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Mon, 17 Mar 2025 17:50:26 +0100 Subject: [PATCH 06/20] Split type definitions from psb_config --- base/modules/Makefile | 2 +- base/modules/psb_config.h.in | 35 --------------------------------- base/modules/psb_fakempi.h | 1 + base/modules/psb_types.h | 38 ++++++++++++++++++++++++++++++++++++ cbind/base/psb_c_base.h | 1 + cuda/cintrf.h | 1 + cuda/spgpu/core.h | 1 + test/pargen/runs/ppde.inp | 2 +- util/psb_amd_order.c | 1 + util/psb_metis_int.h.in | 1 + 10 files changed, 46 insertions(+), 37 deletions(-) create mode 100644 base/modules/psb_types.h diff --git a/base/modules/Makefile b/base/modules/Makefile index 20a848d4..6778092b 100644 --- a/base/modules/Makefile +++ b/base/modules/Makefile @@ -124,7 +124,7 @@ FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). $(FIFLAG). objs: $(MODULES) $(OBJS) $(MPFOBJS) /bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR) - /bin/cp -p $(CPUPDFLAG) psb_config.h $(INCDIR) + /bin/cp -p $(CPUPDFLAG) psb_config.h psb_types.h $(INCDIR) lib: objs $(LIBDIR)/$(LIBNAME) diff --git a/base/modules/psb_config.h.in b/base/modules/psb_config.h.in index b91f87aa..3bf9a645 100644 --- a/base/modules/psb_config.h.in +++ b/base/modules/psb_config.h.in @@ -1,15 +1,6 @@ #ifndef PSB_CONFIG_H #define PSB_CONFIG_H -#include - -#ifdef __cplusplus -#include -#else -#include -#include -#endif - #define PSB_ERR_ERROR -1 #define PSB_ERR_SUCCESS 0 @@ -35,30 +26,4 @@ - typedef int32_t psb_m_t; - -#if defined(PSB_IPK4) && defined(PSB_LPK4) - typedef int32_t psb_i_t; - typedef int32_t psb_l_t; -#elif defined(PSB_IPK4) && defined(PSB_LPK8) - typedef int32_t psb_i_t; - typedef int64_t psb_l_t; -#elif defined(PSB_IPK8) && defined(PSB_LPK8) - typedef int64_t psb_i_t; - typedef int64_t psb_l_t; -#else -#endif - typedef int64_t psb_e_t; - - typedef float psb_s_t; - typedef double psb_d_t; - -#ifdef __cplusplus - typedef std::complex psb_c_t; - typedef std::complex psb_z_t; -#else - typedef float complex psb_c_t; - typedef double complex psb_z_t; -#endif - #endif diff --git a/base/modules/psb_fakempi.h b/base/modules/psb_fakempi.h index 27973fbd..164f4794 100644 --- a/base/modules/psb_fakempi.h +++ b/base/modules/psb_fakempi.h @@ -1,6 +1,7 @@ #ifndef PSB_FAKEMPI_H #define PSB_FAKEMPI_H #include "psb_config.h" +#include "psb_types.h" #define MPI_INTEGER 1 #define MPI_INTEGER8 2 diff --git a/base/modules/psb_types.h b/base/modules/psb_types.h new file mode 100644 index 00000000..d8495ff9 --- /dev/null +++ b/base/modules/psb_types.h @@ -0,0 +1,38 @@ +#ifndef PSB_TYPES_H +#define PSB_TYPES_H + + +#include + +#ifdef __cplusplus +#include +#else +#include +#include +#endif + typedef int32_t psb_m_t; + +#if defined(PSB_IPK4) && defined(PSB_LPK4) + typedef int32_t psb_i_t; + typedef int32_t psb_l_t; +#elif defined(PSB_IPK4) && defined(PSB_LPK8) + typedef int32_t psb_i_t; + typedef int64_t psb_l_t; +#elif defined(PSB_IPK8) && defined(PSB_LPK8) + typedef int64_t psb_i_t; + typedef int64_t psb_l_t; +#else +#endif + typedef int64_t psb_e_t; + + typedef float psb_s_t; + typedef double psb_d_t; + +#ifdef __cplusplus + typedef std::complex psb_c_t; + typedef std::complex psb_z_t; +#else + typedef float complex psb_c_t; + typedef double complex psb_z_t; +#endif +#endif diff --git a/cbind/base/psb_c_base.h b/cbind/base/psb_c_base.h index 09f7f7dd..601ba8c1 100644 --- a/cbind/base/psb_c_base.h +++ b/cbind/base/psb_c_base.h @@ -14,6 +14,7 @@ extern "C" { #include #include "psb_config.h" +#include "psb_types.h" typedef struct PSB_C_DESCRIPTOR { diff --git a/cuda/cintrf.h b/cuda/cintrf.h index 4f1cb015..c9b70ce3 100644 --- a/cuda/cintrf.h +++ b/cuda/cintrf.h @@ -36,6 +36,7 @@ #include #include #include "psb_config.h" +#include "psb_types.h" #include "core.h" #define ELL_PITCH_ALIGN_S 32 diff --git a/cuda/spgpu/core.h b/cuda/spgpu/core.h index 4ba85fd9..35d5849d 100644 --- a/cuda/spgpu/core.h +++ b/cuda/spgpu/core.h @@ -47,6 +47,7 @@ */ #include "psb_config.h" +#include "psb_types.h" #include "driver_types.h" #include "cuComplex.h" diff --git a/test/pargen/runs/ppde.inp b/test/pargen/runs/ppde.inp index ae8bfe8f..d28af007 100644 --- a/test/pargen/runs/ppde.inp +++ b/test/pargen/runs/ppde.inp @@ -2,7 +2,7 @@ BICGSTAB Iterative method BICGSTAB CGS BICG BICGSTABL RGMRES FCG CGR RICHARDSON BJAC Preconditioner NONE DIAG BJAC CSR Storage format for matrix A: CSR COO -200 Domain size (acutal system is this**3 (pde3d) or **2 (pde2d) ) +100 Domain size (acutal system is this**3 (pde3d) or **2 (pde2d) ) 3 Partition: 1 BLOCK 3 3D 2 Stopping criterion 1 2 0200 MAXIT diff --git a/util/psb_amd_order.c b/util/psb_amd_order.c index 5c2f1a18..13130396 100644 --- a/util/psb_amd_order.c +++ b/util/psb_amd_order.c @@ -30,6 +30,7 @@ */ #include "psb_config.h" +#include "psb_types.h" #ifdef PSB_HAVE_AMD #include "amd.h" #endif diff --git a/util/psb_metis_int.h.in b/util/psb_metis_int.h.in index c13ffd2c..873fd3c9 100644 --- a/util/psb_metis_int.h.in +++ b/util/psb_metis_int.h.in @@ -1,6 +1,7 @@ #include #include #include "psb_config.h" +#include "psb_types.h" #if defined(PSB_HAVE_METIS) #include "@METISINCFILE@" #endif From 6473cd8a85f89063620c6cfc88a4c2f9f815c7af Mon Sep 17 00:00:00 2001 From: sfilippone Date: Wed, 19 Mar 2025 14:33:08 +0100 Subject: [PATCH 07/20] Fix usage of --enable-XXX --- config/pac.m4 | 21 +++++++-------------- configure | 12 ++++-------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/config/pac.m4 b/config/pac.m4 index 98da0f6e..9a9a1b0f 100644 --- a/config/pac.m4 +++ b/config/pac.m4 @@ -380,7 +380,7 @@ AC_ARG_ENABLE(serial, AS_HELP_STRING([--enable-serial], [Specify whether to enable a fake mpi library to run in serial mode. ]), [ -pac_cv_serial_mpi="yes"; +pac_cv_serial_mpi="$enableval"; ] dnl , dnl [pac_cv_serial_mpi="no";] @@ -388,7 +388,6 @@ dnl [pac_cv_serial_mpi="no";] if test x"$pac_cv_serial_mpi" == x"yes" ; then AC_MSG_RESULT([yes.]) else - pac_cv_serial_mpi="no"; AC_MSG_RESULT([no.]) fi ] @@ -410,12 +409,8 @@ AC_DEFUN([PAC_ARG_OPENMP], AC_ARG_ENABLE(openmp, AS_HELP_STRING([--enable-openmp], [Specify whether to enable openmp. ]), -[ -pac_cv_openmp="yes"; -] -dnl , -dnl [pac_cv_openmp="no";] - ) +[pac_cv_openmp="$enableval";]) +dnl AC_MSG_NOTICE([Result from test: "x$pac_cv_openmp"]) if test x"$pac_cv_openmp" == x"yes" ; then AC_MSG_RESULT([yes.]) AC_LANG_PUSH([Fortran]) @@ -455,7 +450,7 @@ AC_ARG_ENABLE(long-integers, AS_HELP_STRING([--enable-long-integers], [Specify usage of 64 bits integers. ]), [ -pac_cv_long_integers="yes"; +pac_cv_long_integers="$enableval"; ] dnl , dnl [pac_cv_long_integers="no";] @@ -2174,11 +2169,9 @@ AC_ARG_ENABLE(cuda, AS_HELP_STRING([--enable-cuda], [Specify whether to enable cuda. ]), [ -pac_cv_cuda="yes"; +pac_cv_cuda="$enableval"; ] -dnl , -dnl [pac_cv_cuda="no";] - ) +) ] ) @@ -2329,7 +2322,7 @@ AC_ARG_ENABLE(openacc, AS_HELP_STRING([--enable-openacc], [Specify whether to enable openacc. ]), [ -pac_cv_openacc="yes"; +pac_cv_openacc="$enableval"; ] dnl , dnl [pac_cv_openacc="no";] diff --git a/configure b/configure index 7ea6582e..662dd77e 100755 --- a/configure +++ b/configure @@ -4626,7 +4626,7 @@ printf %s "checking whether we want serial mpi stubs... " >&6; } if test ${enable_serial+y} then : enableval=$enable_serial; -pac_cv_serial_mpi="yes"; +pac_cv_serial_mpi="$enableval"; fi @@ -4635,7 +4635,6 @@ if test x"$pac_cv_serial_mpi" == x"yes" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes." >&5 printf "%s\n" "yes." >&6; } else - pac_cv_serial_mpi="no"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no." >&5 printf "%s\n" "no." >&6; } fi @@ -7443,10 +7442,7 @@ printf %s "checking whether we want openmp ... " >&6; } # Check whether --enable-openmp was given. if test ${enable_openmp+y} then : - enableval=$enable_openmp; -pac_cv_openmp="yes"; - - + enableval=$enable_openmp; pac_cv_openmp="$enableval"; fi if test x"$pac_cv_openmp" == x"yes" ; then @@ -10380,7 +10376,7 @@ printf %s "checking whether we want cuda ... " >&6; } if test ${enable_cuda+y} then : enableval=$enable_cuda; -pac_cv_cuda="yes"; +pac_cv_cuda="$enableval"; fi @@ -10668,7 +10664,7 @@ printf %s "checking whether we want openacc ... " >&6; } if test ${enable_openacc+y} then : enableval=$enable_openacc; -pac_cv_openacc="yes"; +pac_cv_openacc="$enableval"; fi From 5b1d4fb9cdc327cf3accd92defb6e6c71b361d75 Mon Sep 17 00:00:00 2001 From: Fabio Durastante Date: Thu, 20 Mar 2025 09:04:31 +0100 Subject: [PATCH 08/20] Exclude generated psb_config.h from git tracking --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d190e4c7..a1719f69 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ # header files generated /cbind/*.h /util/psb_metis_int.h +/base/modules/psb_config.h # Make.inc generated /Make.inc From 7201e511beaacda7d23341786dea34f88d8fbfca Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Sun, 23 Mar 2025 11:25:48 +0100 Subject: [PATCH 09/20] Renamed into test/pdegen, also in the C interface --- Makefile | 4 ++-- cbind/test/{pargen => pdegen}/Makefile | 17 ++++++----------- .../test/{pargen/ppdec.c => pdegen/pdegen3dc.c} | 0 .../runs/ppde.inp => pdegen/runs/pdegen3d.inp} | 0 test/pargen/runs/mach | 8 -------- test/{pargen => pdegen}/CMakeLists.txt | 0 test/{pargen => pdegen}/Makefile | 0 test/{pargen => pdegen}/psb_d_pde2d.F90 | 0 test/{pargen => pdegen}/psb_d_pde3d.F90 | 0 test/{pargen => pdegen}/psb_s_pde2d.F90 | 0 test/{pargen => pdegen}/psb_s_pde3d.F90 | 0 .../runs/ppde.inp => pdegen/runs/psb_pde3d.inp} | 2 +- 12 files changed, 9 insertions(+), 22 deletions(-) rename cbind/test/{pargen => pdegen}/Makefile (56%) rename cbind/test/{pargen/ppdec.c => pdegen/pdegen3dc.c} (100%) rename cbind/test/{pargen/runs/ppde.inp => pdegen/runs/pdegen3d.inp} (100%) delete mode 100644 test/pargen/runs/mach rename test/{pargen => pdegen}/CMakeLists.txt (100%) rename test/{pargen => pdegen}/Makefile (100%) rename test/{pargen => pdegen}/psb_d_pde2d.F90 (100%) rename test/{pargen => pdegen}/psb_d_pde3d.F90 (100%) rename test/{pargen => pdegen}/psb_s_pde2d.F90 (100%) rename test/{pargen => pdegen}/psb_s_pde3d.F90 (100%) rename test/{pargen/runs/ppde.inp => pdegen/runs/psb_pde3d.inp} (98%) diff --git a/Makefile b/Makefile index 34550195..c3b6b8f3 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ oaccld: oaccd based: $(MAKE) -C base objs precd: - $(MAKE) -C prec objs + $(MAKE) -C prec objs8 linslvd: $(MAKE) -C linsolve objs utild: @@ -62,7 +62,7 @@ install: all mkdir -p $(INSTALL_DOCSDIR) && \ $(INSTALL_DATA) README.md LICENSE $(INSTALL_DOCSDIR) mkdir -p $(INSTALL_SAMPLESDIR) && \ - /bin/cp -fr test/pargen test/fileread $(INSTALL_SAMPLESDIR) && \ + /bin/cp -fr test/pdegen test/fileread $(INSTALL_SAMPLESDIR) && \ mkdir -p $(INSTALL_SAMPLESDIR)/cbind && /bin/cp -fr cbind/test/pargen/* $(INSTALL_SAMPLESDIR)/cbind clean: cleanlib $(MAKE) -C base veryclean diff --git a/cbind/test/pargen/Makefile b/cbind/test/pdegen/Makefile similarity index 56% rename from cbind/test/pargen/Makefile rename to cbind/test/pdegen/Makefile index e1da6892..071f54b8 100644 --- a/cbind/test/pargen/Makefile +++ b/cbind/test/pdegen/Makefile @@ -17,17 +17,12 @@ PSB_LIBS=-lpsb_util -lpsb_linsolve -lpsb_prec -lpsb_base -L$(LIBDIR) EXEDIR=./runs -all: ppdec build +all: pdegen3dc -ppdec: ppdec.o - $(MPFC) ppdec.o -o ppdec $(PSBC_LIBS) $(PSB_LIBS) $(PSBLDLIBS) -lm -lgfortran - /bin/mv ppdec $(EXEDIR) +pdegen3dc: pdegen3dc.o + $(MPFC) pdegen3dc.o -o pdegen3dc $(PSBC_LIBS) $(PSB_LIBS) $(PSBLDLIBS) -lm -lgfortran + /bin/mv pdegen3dc $(EXEDIR) -build: build.o - $(MPFC) build.o -o build $(PSBC_LIBS) $(PSB_LIBS) $(PSBLDLIBS) -lm -lgfortran - /bin/mv build $(EXEDIR) -# \ -# -lifcore -lifcoremt -lguide -limf -lirc -lintlc -lcxaguard -L/opt/intel/fc/10.0.023/lib/ -lm .f90.o: $(MPFC) $(FCOPT) $(FINCLUDES) $(FDEFINES) -c $< @@ -36,11 +31,11 @@ build: build.o clean: - /bin/rm -f ppdec.o build.o $(EXEDIR)/ppdec + /bin/rm -f pdegen3dc.o $(EXEDIR)/pdegen3dc verycleanlib: (cd ../..; make veryclean) lib: (cd ../../; make library) tests: all - cd runs ; ./ppdec < ppde.inp + cd runs ; ./pdegen3dc < pdegen3d.inp diff --git a/cbind/test/pargen/ppdec.c b/cbind/test/pdegen/pdegen3dc.c similarity index 100% rename from cbind/test/pargen/ppdec.c rename to cbind/test/pdegen/pdegen3dc.c diff --git a/cbind/test/pargen/runs/ppde.inp b/cbind/test/pdegen/runs/pdegen3d.inp similarity index 100% rename from cbind/test/pargen/runs/ppde.inp rename to cbind/test/pdegen/runs/pdegen3d.inp diff --git a/test/pargen/runs/mach b/test/pargen/runs/mach deleted file mode 100644 index 60432829..00000000 --- a/test/pargen/runs/mach +++ /dev/null @@ -1,8 +0,0 @@ -localhost -localhost -localhost -localhost -localhost -localhost -localhost -localhost diff --git a/test/pargen/CMakeLists.txt b/test/pdegen/CMakeLists.txt similarity index 100% rename from test/pargen/CMakeLists.txt rename to test/pdegen/CMakeLists.txt diff --git a/test/pargen/Makefile b/test/pdegen/Makefile similarity index 100% rename from test/pargen/Makefile rename to test/pdegen/Makefile diff --git a/test/pargen/psb_d_pde2d.F90 b/test/pdegen/psb_d_pde2d.F90 similarity index 100% rename from test/pargen/psb_d_pde2d.F90 rename to test/pdegen/psb_d_pde2d.F90 diff --git a/test/pargen/psb_d_pde3d.F90 b/test/pdegen/psb_d_pde3d.F90 similarity index 100% rename from test/pargen/psb_d_pde3d.F90 rename to test/pdegen/psb_d_pde3d.F90 diff --git a/test/pargen/psb_s_pde2d.F90 b/test/pdegen/psb_s_pde2d.F90 similarity index 100% rename from test/pargen/psb_s_pde2d.F90 rename to test/pdegen/psb_s_pde2d.F90 diff --git a/test/pargen/psb_s_pde3d.F90 b/test/pdegen/psb_s_pde3d.F90 similarity index 100% rename from test/pargen/psb_s_pde3d.F90 rename to test/pdegen/psb_s_pde3d.F90 diff --git a/test/pargen/runs/ppde.inp b/test/pdegen/runs/psb_pde3d.inp similarity index 98% rename from test/pargen/runs/ppde.inp rename to test/pdegen/runs/psb_pde3d.inp index d28af007..a924677a 100644 --- a/test/pargen/runs/ppde.inp +++ b/test/pdegen/runs/psb_pde3d.inp @@ -2,7 +2,7 @@ BICGSTAB Iterative method BICGSTAB CGS BICG BICGSTABL RGMRES FCG CGR RICHARDSON BJAC Preconditioner NONE DIAG BJAC CSR Storage format for matrix A: CSR COO -100 Domain size (acutal system is this**3 (pde3d) or **2 (pde2d) ) +100 Domain size (acutal system is this**3 (pde3d) ) 3 Partition: 1 BLOCK 3 3D 2 Stopping criterion 1 2 0200 MAXIT From df6dc1bb3ed211f2e5ada6d3c4b1cea1472fe90f Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Sun, 23 Mar 2025 11:34:37 +0100 Subject: [PATCH 10/20] Fix typo in makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c3b6b8f3..25fb4c3c 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ oaccld: oaccd based: $(MAKE) -C base objs precd: - $(MAKE) -C prec objs8 + $(MAKE) -C prec objs linslvd: $(MAKE) -C linsolve objs utild: From 1ded01bb1ab84e45d278e3663970d67db4a9944c Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Sun, 23 Mar 2025 11:35:57 +0100 Subject: [PATCH 11/20] Further fixes on main makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 25fb4c3c..7de3082d 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,7 @@ install: all $(INSTALL_DATA) README.md LICENSE $(INSTALL_DOCSDIR) mkdir -p $(INSTALL_SAMPLESDIR) && \ /bin/cp -fr test/pdegen test/fileread $(INSTALL_SAMPLESDIR) && \ - mkdir -p $(INSTALL_SAMPLESDIR)/cbind && /bin/cp -fr cbind/test/pargen/* $(INSTALL_SAMPLESDIR)/cbind + mkdir -p $(INSTALL_SAMPLESDIR)/cbind && /bin/cp -fr cbind/test/pdegen/* $(INSTALL_SAMPLESDIR)/cbind clean: cleanlib $(MAKE) -C base veryclean $(MAKE) -C prec veryclean @@ -75,7 +75,7 @@ clean: cleanlib $(MAKE) -C openacc veryclean cleantest: cd test/fileread && $(MAKE) clean - cd test/pargen && $(MAKE) clean + cd test/pdegen && $(MAKE) clean cd test/util && $(MAKE) clean cleanlib: From 69a845b8f5b59babdf56c864c4a4cc314927699a Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Sun, 23 Mar 2025 11:36:48 +0100 Subject: [PATCH 12/20] Fix in cbind makefile --- cbind/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cbind/Makefile b/cbind/Makefile index acc82fa9..9724c711 100644 --- a/cbind/Makefile +++ b/cbind/Makefile @@ -33,5 +33,5 @@ clean: cd util && $(MAKE) clean veryclean: clean - cd test/pargen && $(MAKE) clean + cd test/pdegen && $(MAKE) clean /bin/rm -f $(HERE)/$(LIBNAME) $(LIBMOD) *$(.mod) *.h From 91af21552c2759abce12e426abe4e65b1c58fa1a Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Sun, 23 Mar 2025 11:44:47 +0100 Subject: [PATCH 13/20] New pde2d.inp file in test/pdegen --- test/pdegen/runs/psb_pde2d.inp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/pdegen/runs/psb_pde2d.inp diff --git a/test/pdegen/runs/psb_pde2d.inp b/test/pdegen/runs/psb_pde2d.inp new file mode 100644 index 00000000..f977ac89 --- /dev/null +++ b/test/pdegen/runs/psb_pde2d.inp @@ -0,0 +1,18 @@ +17 Number of entries below this +BICGSTAB Iterative method BICGSTAB CGS BICG BICGSTABL RGMRES FCG CGR RICHARDSON +BJAC Preconditioner NONE DIAG BJAC +CSR Storage format for matrix A: CSR COO +1000 Domain size (acutal system is **2 (pde2d) ) +3 Partition: 1 BLOCK 3 3D +2 Stopping criterion 1 2 +0200 MAXIT +10 ITRACE +002 IRST restart for RGMRES and BiCGSTABL +INVK Block Solver ILU,ILUT,INVK,INVT,AINV +NONE If ILU : MILU or NONE othewise ignored +NONE Scaling if ILUT: NONE, MAXVAL otherwise ignored +0 Level of fill for forward factorization +1 Level of fill for inverse factorization (only INVK,INVT) +1E-1 Threshold for forward factorization +1E-1 Threshold for inverse factorization (Only INVK, INVT) +LLK What orthogonalization algorithm? (Only AINV) From 9d6ad2ac85673c13d64a35e12baf29f41b9785c1 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Sun, 23 Mar 2025 11:46:37 +0100 Subject: [PATCH 14/20] Update test input 2D --- test/pdegen/runs/psb_pde2d.inp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/pdegen/runs/psb_pde2d.inp b/test/pdegen/runs/psb_pde2d.inp index f977ac89..e07773dc 100644 --- a/test/pdegen/runs/psb_pde2d.inp +++ b/test/pdegen/runs/psb_pde2d.inp @@ -2,10 +2,10 @@ BICGSTAB Iterative method BICGSTAB CGS BICG BICGSTABL RGMRES FCG CGR RICHARDSON BJAC Preconditioner NONE DIAG BJAC CSR Storage format for matrix A: CSR COO -1000 Domain size (acutal system is **2 (pde2d) ) +300 Domain size (acutal system is **2 (pde2d) ) 3 Partition: 1 BLOCK 3 3D 2 Stopping criterion 1 2 -0200 MAXIT +0300 MAXIT 10 ITRACE 002 IRST restart for RGMRES and BiCGSTABL INVK Block Solver ILU,ILUT,INVK,INVT,AINV From f5b1661e144ad3a38b6cabc50dc6f20620de1a62 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Mon, 24 Mar 2025 09:03:22 +0100 Subject: [PATCH 15/20] Fix fileread getp for single precision data --- test/fileread/getp.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fileread/getp.f90 b/test/fileread/getp.f90 index 82bef762..db8207b6 100644 --- a/test/fileread/getp.f90 +++ b/test/fileread/getp.f90 @@ -198,7 +198,7 @@ contains read(inp_unit,*) kmethd read(inp_unit,*) ptype read(inp_unit,*) afmt - read(inp_unit,*) ipart + read(inp_unit,*) part call psb_bcast(ctxt,mtrx_file) From ecef7d86539ae6696830a12eb0c0b2bee4700943 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Wed, 26 Mar 2025 16:37:28 +0100 Subject: [PATCH 16/20] Improve communication and speed between cd_inloc and hash_init --- base/modules/desc/psb_hash_map_mod.F90 | 42 +++----------------------- base/tools/psb_cd_inloc.f90 | 1 - 2 files changed, 4 insertions(+), 39 deletions(-) diff --git a/base/modules/desc/psb_hash_map_mod.F90 b/base/modules/desc/psb_hash_map_mod.F90 index 9c1b40bc..85000533 100644 --- a/base/modules/desc/psb_hash_map_mod.F90 +++ b/base/modules/desc/psb_hash_map_mod.F90 @@ -1217,11 +1217,9 @@ contains ! To be implemented integer(psb_ipk_) :: iam, np integer(psb_ipk_) :: i, nlu, nl, int_err(5) - integer(psb_lpk_) :: m, nrt - integer(psb_lpk_), allocatable :: vlu(:) - integer(psb_lpk_), allocatable :: ix(:) + integer(psb_lpk_) :: m, nrt character(len=20), parameter :: name='hash_map_init_vl' - + real(psb_dpk_) :: t0, t1, t2,t3, t4, t5 info = 0 call psb_info(ctxt,iam,np) if (np < 0) then @@ -1229,7 +1227,6 @@ contains info = -1 return end if - nl = size(vl) m = maxval(vl(1:nl)) @@ -1237,46 +1234,15 @@ contains call psb_sum(ctxt,nrt) call psb_max(ctxt,m) - allocate(vlu(nl), ix(nl), stat=info) - if (info /= 0) then - info = -1 - return - end if - - do i=1,nl - if ((vl(i)<1).or.(vl(i)>m)) then - info = psb_err_entry_out_of_bounds_ - int_err(1) = i - int_err(2) = vl(i) - int_err(3) = nl - int_err(4) = m - exit - endif - vlu(i) = vl(i) - end do - if ((m /= nrt).and.(iam == psb_root_)) then write(psb_err_unit,*) trim(name),& - & ' Warning: globalcheck=.false., but there is a mismatch' + & ' Warning: we got to hash_init_vl but there is a mismatch' write(psb_err_unit,*) trim(name),& & ' : in the global sizes!',m,nrt end if - - call psb_msort(vlu,ix) - nlu = 1 - do i=2,nl - if (vlu(i) /= vlu(nlu)) then - nlu = nlu + 1 - vlu(nlu) = vlu(i) - ix(nlu) = ix(i) - end if - end do - call psb_msort(ix(1:nlu),vlu(1:nlu),flag=psb_sort_keep_idx_) + call hash_init_vlu(idxmap,ctxt,m,nl,vl,info) - nlu = nl - call hash_init_vlu(idxmap,ctxt,m,nlu,vlu,info) - end subroutine hash_init_vl subroutine hash_init_vg(idxmap,ctxt,vg,info) diff --git a/base/tools/psb_cd_inloc.f90 b/base/tools/psb_cd_inloc.f90 index 30c3e9b3..3f2b2e08 100644 --- a/base/tools/psb_cd_inloc.f90 +++ b/base/tools/psb_cd_inloc.f90 @@ -163,7 +163,6 @@ subroutine psb_cd_inloc(v, ctxt, desc, info, globalcheck,idx,usehash) ! 3. any overlap? ! Checks 2 and 3 are controlled by globalcheck ! - if (check_.or.(.not.islarge)) then if (debug_size) & & write(debug_unit,*) me,' ',trim(name),': Going for global checks' From c4ab4be45de3f79293e2693748f39c47363d3f08 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Thu, 27 Mar 2025 11:23:40 +0100 Subject: [PATCH 17/20] Cleanup some cuda compile warnings. --- cuda/spgpu/kernels/caxpby.cu | 1 - cuda/spgpu/kernels/cupd_xyz.cu | 1 - cuda/spgpu/kernels/cxyzw.cu | 1 - cuda/spgpu/kernels/daxpby.cu | 1 - cuda/spgpu/kernels/dupd_xyz.cu | 1 - cuda/spgpu/kernels/dxyzw.cu | 1 - cuda/spgpu/kernels/saxpby.cu | 1 - cuda/spgpu/kernels/supd_xyz.cu | 1 - cuda/spgpu/kernels/sxyzw.cu | 1 - cuda/spgpu/kernels/zaxpby.cu | 1 - cuda/spgpu/kernels/zupd_xyz.cu | 1 - cuda/spgpu/kernels/zxyzw.cu | 1 - 12 files changed, 12 deletions(-) diff --git a/cuda/spgpu/kernels/caxpby.cu b/cuda/spgpu/kernels/caxpby.cu index bea30d94..a89f2b9c 100644 --- a/cuda/spgpu/kernels/caxpby.cu +++ b/cuda/spgpu/kernels/caxpby.cu @@ -63,7 +63,6 @@ void spgpuCaxpby(spgpuHandle_t handle, cuFloatComplex alpha, __device cuFloatComplex* x) { - int msize = (n+BLOCK_SIZE-1)/BLOCK_SIZE; int num_mp, max_threads_mp, num_blocks_mp, num_blocks; dim3 block(BLOCK_SIZE); num_mp = getGPUMultiProcessors(); diff --git a/cuda/spgpu/kernels/cupd_xyz.cu b/cuda/spgpu/kernels/cupd_xyz.cu index 04c137ff..e8dc9300 100644 --- a/cuda/spgpu/kernels/cupd_xyz.cu +++ b/cuda/spgpu/kernels/cupd_xyz.cu @@ -65,7 +65,6 @@ void spgpuCupd_xyz(spgpuHandle_t handle, __device cuFloatComplex * y, __device cuFloatComplex *z) { - int msize = (n+BLOCK_SIZE-1)/BLOCK_SIZE; int num_mp, max_threads_mp, num_blocks_mp, num_blocks; dim3 block(BLOCK_SIZE); num_mp = getGPUMultiProcessors(); diff --git a/cuda/spgpu/kernels/cxyzw.cu b/cuda/spgpu/kernels/cxyzw.cu index 3047d65c..783c7714 100644 --- a/cuda/spgpu/kernels/cxyzw.cu +++ b/cuda/spgpu/kernels/cxyzw.cu @@ -63,7 +63,6 @@ void spgpuCxyzw(spgpuHandle_t handle, __device cuFloatComplex * z, __device cuFloatComplex *w) { - int msize = (n+BLOCK_SIZE-1)/BLOCK_SIZE; int num_mp, max_threads_mp, num_blocks_mp, num_blocks; dim3 block(BLOCK_SIZE); num_mp = getGPUMultiProcessors(); diff --git a/cuda/spgpu/kernels/daxpby.cu b/cuda/spgpu/kernels/daxpby.cu index 3a388988..41e493b1 100644 --- a/cuda/spgpu/kernels/daxpby.cu +++ b/cuda/spgpu/kernels/daxpby.cu @@ -60,7 +60,6 @@ void spgpuDaxpby(spgpuHandle_t handle, double alpha, __device double* x) { - int msize = (n+BLOCK_SIZE-1)/BLOCK_SIZE; int num_mp, max_threads_mp, num_blocks_mp, num_blocks; dim3 block(BLOCK_SIZE); num_mp = getGPUMultiProcessors(); diff --git a/cuda/spgpu/kernels/dupd_xyz.cu b/cuda/spgpu/kernels/dupd_xyz.cu index d0060694..11fc6c9a 100644 --- a/cuda/spgpu/kernels/dupd_xyz.cu +++ b/cuda/spgpu/kernels/dupd_xyz.cu @@ -64,7 +64,6 @@ void spgpuDupd_xyz(spgpuHandle_t handle, __device double* y, __device double *z) { - int msize = (n+BLOCK_SIZE-1)/BLOCK_SIZE; int num_mp, max_threads_mp, num_blocks_mp, num_blocks; dim3 block(BLOCK_SIZE); num_mp = getGPUMultiProcessors(); diff --git a/cuda/spgpu/kernels/dxyzw.cu b/cuda/spgpu/kernels/dxyzw.cu index ab93a379..f9964cc7 100644 --- a/cuda/spgpu/kernels/dxyzw.cu +++ b/cuda/spgpu/kernels/dxyzw.cu @@ -63,7 +63,6 @@ void spgpuDxyzw(spgpuHandle_t handle, __device double * z, __device double *w) { - int msize = (n+BLOCK_SIZE-1)/BLOCK_SIZE; int num_mp, max_threads_mp, num_blocks_mp, num_blocks; dim3 block(BLOCK_SIZE); num_mp = getGPUMultiProcessors(); diff --git a/cuda/spgpu/kernels/saxpby.cu b/cuda/spgpu/kernels/saxpby.cu index ebb41350..ab103bbb 100644 --- a/cuda/spgpu/kernels/saxpby.cu +++ b/cuda/spgpu/kernels/saxpby.cu @@ -62,7 +62,6 @@ void spgpuSaxpby(spgpuHandle_t handle, float alpha, __device float* x) { - int msize = (n+BLOCK_SIZE-1)/BLOCK_SIZE; int num_mp, max_threads_mp, num_blocks_mp, num_blocks; dim3 block(BLOCK_SIZE); num_mp = getGPUMultiProcessors(); diff --git a/cuda/spgpu/kernels/supd_xyz.cu b/cuda/spgpu/kernels/supd_xyz.cu index e8d7b028..0bfed1ae 100644 --- a/cuda/spgpu/kernels/supd_xyz.cu +++ b/cuda/spgpu/kernels/supd_xyz.cu @@ -64,7 +64,6 @@ void spgpuSupd_xyz(spgpuHandle_t handle, __device float* y, __device float *z) { - int msize = (n+BLOCK_SIZE-1)/BLOCK_SIZE; int num_mp, max_threads_mp, num_blocks_mp, num_blocks; dim3 block(BLOCK_SIZE); num_mp = getGPUMultiProcessors(); diff --git a/cuda/spgpu/kernels/sxyzw.cu b/cuda/spgpu/kernels/sxyzw.cu index f69d087e..26422e55 100644 --- a/cuda/spgpu/kernels/sxyzw.cu +++ b/cuda/spgpu/kernels/sxyzw.cu @@ -63,7 +63,6 @@ void spgpuSxyzw(spgpuHandle_t handle, __device float * z, __device float *w) { - int msize = (n+BLOCK_SIZE-1)/BLOCK_SIZE; int num_mp, max_threads_mp, num_blocks_mp, num_blocks; dim3 block(BLOCK_SIZE); num_mp = getGPUMultiProcessors(); diff --git a/cuda/spgpu/kernels/zaxpby.cu b/cuda/spgpu/kernels/zaxpby.cu index c576acbd..07122ff5 100644 --- a/cuda/spgpu/kernels/zaxpby.cu +++ b/cuda/spgpu/kernels/zaxpby.cu @@ -64,7 +64,6 @@ void spgpuZaxpby(spgpuHandle_t handle, cuDoubleComplex alpha, __device cuDoubleComplex* x) { - int msize = (n+BLOCK_SIZE-1)/BLOCK_SIZE; int num_mp, max_threads_mp, num_blocks_mp, num_blocks; dim3 block(BLOCK_SIZE); num_mp = getGPUMultiProcessors(); diff --git a/cuda/spgpu/kernels/zupd_xyz.cu b/cuda/spgpu/kernels/zupd_xyz.cu index 360b87bd..3a7f4c00 100644 --- a/cuda/spgpu/kernels/zupd_xyz.cu +++ b/cuda/spgpu/kernels/zupd_xyz.cu @@ -65,7 +65,6 @@ void spgpuZupd_xyz(spgpuHandle_t handle, __device cuDoubleComplex * y, __device cuDoubleComplex *z) { - int msize = (n+BLOCK_SIZE-1)/BLOCK_SIZE; int num_mp, max_threads_mp, num_blocks_mp, num_blocks; dim3 block(BLOCK_SIZE); num_mp = getGPUMultiProcessors(); diff --git a/cuda/spgpu/kernels/zxyzw.cu b/cuda/spgpu/kernels/zxyzw.cu index b07b6aa9..c02991dd 100644 --- a/cuda/spgpu/kernels/zxyzw.cu +++ b/cuda/spgpu/kernels/zxyzw.cu @@ -63,7 +63,6 @@ void spgpuZxyzw(spgpuHandle_t handle, __device cuDoubleComplex * z, __device cuDoubleComplex *w) { - int msize = (n+BLOCK_SIZE-1)/BLOCK_SIZE; int num_mp, max_threads_mp, num_blocks_mp, num_blocks; dim3 block(BLOCK_SIZE); num_mp = getGPUMultiProcessors(); From 503c1e575f9eaab9c8d8bd39aabbb2e39536df98 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Thu, 27 Mar 2025 11:59:19 +0100 Subject: [PATCH 18/20] Cleanup dependencies in main makefile --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7de3082d..fd18a38c 100644 --- a/Makefile +++ b/Makefile @@ -40,11 +40,11 @@ utild: $(MAKE) -C util objs cbindd: $(MAKE) -C cbind objs -extd: based +extd: $(MAKE) -C ext objs -cudad: based extd +cudad: $(MAKE) -C cuda objs -oaccd: based extd +oaccd: $(MAKE) -C openacc objs From a3496d8cb517aa04fcda8a45f618279c99f0a722 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Thu, 27 Mar 2025 12:39:50 +0100 Subject: [PATCH 19/20] Add error handling after CDALL in samples --- base/tools/psb_cd_inloc.f90 | 4 +--- test/pdegen/psb_d_pde2d.F90 | 3 +++ test/pdegen/psb_d_pde3d.F90 | 3 +++ test/pdegen/psb_s_pde2d.F90 | 3 +++ test/pdegen/psb_s_pde3d.F90 | 3 +++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/base/tools/psb_cd_inloc.f90 b/base/tools/psb_cd_inloc.f90 index 3f2b2e08..7315f376 100644 --- a/base/tools/psb_cd_inloc.f90 +++ b/base/tools/psb_cd_inloc.f90 @@ -247,7 +247,6 @@ subroutine psb_cd_inloc(v, ctxt, desc, info, globalcheck,idx,usehash) if (check_) then ! Sort, eliminate duplicates, then ! scramble back into original position. - ix(1) = -1 if (present(idx)) then if (size(idx) >= loc_row) then !$omp parallel do private(i) @@ -255,8 +254,7 @@ subroutine psb_cd_inloc(v, ctxt, desc, info, globalcheck,idx,usehash) ix(i) = idx(i) end do end if - end if - if (ix(1) == -1) then + else !$omp parallel do private(i) do i=1, loc_row ix(i) = i diff --git a/test/pdegen/psb_d_pde2d.F90 b/test/pdegen/psb_d_pde2d.F90 index 49c339d6..ee7cb7f6 100644 --- a/test/pdegen/psb_d_pde2d.F90 +++ b/test/pdegen/psb_d_pde2d.F90 @@ -281,6 +281,7 @@ contains ! contiguous rows ! call psb_cdall(ctxt,desc_a,info,nl=nr) + if (info /=0) goto 9999 myidx = desc_a%get_global_indices() nlr = size(myidx) @@ -308,6 +309,7 @@ contains ! process that owns it ! call psb_cdall(ctxt,desc_a,info,vg=iv) + if (info /=0) goto 9999 myidx = desc_a%get_global_indices() nlr = size(myidx) @@ -357,6 +359,7 @@ contains ! the set of global indices it owns. ! call psb_cdall(ctxt,desc_a,info,vl=myidx) + if (info /=0) goto 9999 ! ! Specify process topology diff --git a/test/pdegen/psb_d_pde3d.F90 b/test/pdegen/psb_d_pde3d.F90 index b45856fa..1f323a46 100644 --- a/test/pdegen/psb_d_pde3d.F90 +++ b/test/pdegen/psb_d_pde3d.F90 @@ -297,6 +297,7 @@ contains ! contiguous rows ! call psb_cdall(ctxt,desc_a,info,nl=nr) + if (info /=0) goto 9999 myidx = desc_a%get_global_indices() nlr = size(myidx) @@ -324,6 +325,7 @@ contains ! process that owns it ! call psb_cdall(ctxt,desc_a,info,vg=iv) + if (info /=0) goto 9999 myidx = desc_a%get_global_indices() nlr = size(myidx) @@ -378,6 +380,7 @@ contains ! the set of global indices it owns. ! call psb_cdall(ctxt,desc_a,info,vl=myidx) + if (info /=0) goto 9999 ! ! Specify process topology diff --git a/test/pdegen/psb_s_pde2d.F90 b/test/pdegen/psb_s_pde2d.F90 index 4df1c05c..c27d2ebe 100644 --- a/test/pdegen/psb_s_pde2d.F90 +++ b/test/pdegen/psb_s_pde2d.F90 @@ -281,6 +281,7 @@ contains ! contiguous rows ! call psb_cdall(ctxt,desc_a,info,nl=nr) + if (info /=0) goto 9999 myidx = desc_a%get_global_indices() nlr = size(myidx) @@ -308,6 +309,7 @@ contains ! process that owns it ! call psb_cdall(ctxt,desc_a,info,vg=iv) + if (info /=0) goto 9999 myidx = desc_a%get_global_indices() nlr = size(myidx) @@ -357,6 +359,7 @@ contains ! the set of global indices it owns. ! call psb_cdall(ctxt,desc_a,info,vl=myidx) + if (info /=0) goto 9999 ! ! Specify process topology diff --git a/test/pdegen/psb_s_pde3d.F90 b/test/pdegen/psb_s_pde3d.F90 index f2e2f500..a80d94f8 100644 --- a/test/pdegen/psb_s_pde3d.F90 +++ b/test/pdegen/psb_s_pde3d.F90 @@ -297,6 +297,7 @@ contains ! contiguous rows ! call psb_cdall(ctxt,desc_a,info,nl=nr) + if (info /=0) goto 9999 myidx = desc_a%get_global_indices() nlr = size(myidx) @@ -324,6 +325,7 @@ contains ! process that owns it ! call psb_cdall(ctxt,desc_a,info,vg=iv) + if (info /=0) goto 9999 myidx = desc_a%get_global_indices() nlr = size(myidx) @@ -378,6 +380,7 @@ contains ! the set of global indices it owns. ! call psb_cdall(ctxt,desc_a,info,vl=myidx) + if (info /=0) goto 9999 ! ! Specify process topology From 52cec1761c17e630cee8b8fb6d6a604af871d3a5 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Thu, 27 Mar 2025 17:16:51 +0100 Subject: [PATCH 20/20] Switch off detailed timings --- base/psblas/psb_cspmm.f90 | 6 +++--- base/psblas/psb_dspmm.f90 | 6 +++--- base/psblas/psb_sspmm.f90 | 6 +++--- base/psblas/psb_zspmm.f90 | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/base/psblas/psb_cspmm.f90 b/base/psblas/psb_cspmm.f90 index 0f18dc86..69f315ea 100644 --- a/base/psblas/psb_cspmm.f90 +++ b/base/psblas/psb_cspmm.f90 @@ -83,7 +83,7 @@ subroutine psb_cspmv_vect(alpha,a,x,beta,y,desc_a,info,& character(len=20) :: name, ch_err logical :: aliw, doswap_ integer(psb_ipk_) :: debug_level, debug_unit - logical, parameter :: do_timings=.true. + logical, parameter :: do_timings=.false. integer(psb_ipk_), save :: mv_phase1=-1, mv_phase2=-1, mv_phase3=-1, mv_phase4=-1 integer(psb_ipk_), save :: mv_phase11=-1, mv_phase12=-1 @@ -197,7 +197,7 @@ subroutine psb_cspmv_vect(alpha,a,x,beta,y,desc_a,info,& if (allocated(a%ad)) then block - logical, parameter :: do_timings=.true. + logical, parameter :: do_timings=.false. real(psb_dpk_) :: t1, t2, t3, t4, t5 !if (me==0) write(0,*) 'going for overlap ',a%ad%get_fmt(),' ',a%and%get_fmt() if (do_timings) call psb_barrier(ctxt) @@ -218,7 +218,7 @@ subroutine psb_cspmv_vect(alpha,a,x,beta,y,desc_a,info,& else block - logical, parameter :: do_timings=.true. + logical, parameter :: do_timings=.false. real(psb_dpk_) :: t1, t2, t3, t4, t5 if (do_timings) call psb_barrier(ctxt) diff --git a/base/psblas/psb_dspmm.f90 b/base/psblas/psb_dspmm.f90 index dc022cc4..717133fa 100644 --- a/base/psblas/psb_dspmm.f90 +++ b/base/psblas/psb_dspmm.f90 @@ -83,7 +83,7 @@ subroutine psb_dspmv_vect(alpha,a,x,beta,y,desc_a,info,& character(len=20) :: name, ch_err logical :: aliw, doswap_ integer(psb_ipk_) :: debug_level, debug_unit - logical, parameter :: do_timings=.true. + logical, parameter :: do_timings=.false. integer(psb_ipk_), save :: mv_phase1=-1, mv_phase2=-1, mv_phase3=-1, mv_phase4=-1 integer(psb_ipk_), save :: mv_phase11=-1, mv_phase12=-1 @@ -197,7 +197,7 @@ subroutine psb_dspmv_vect(alpha,a,x,beta,y,desc_a,info,& if (allocated(a%ad)) then block - logical, parameter :: do_timings=.true. + logical, parameter :: do_timings=.false. real(psb_dpk_) :: t1, t2, t3, t4, t5 !if (me==0) write(0,*) 'going for overlap ',a%ad%get_fmt(),' ',a%and%get_fmt() if (do_timings) call psb_barrier(ctxt) @@ -218,7 +218,7 @@ subroutine psb_dspmv_vect(alpha,a,x,beta,y,desc_a,info,& else block - logical, parameter :: do_timings=.true. + logical, parameter :: do_timings=.false. real(psb_dpk_) :: t1, t2, t3, t4, t5 if (do_timings) call psb_barrier(ctxt) diff --git a/base/psblas/psb_sspmm.f90 b/base/psblas/psb_sspmm.f90 index e6fbaab9..0e432054 100644 --- a/base/psblas/psb_sspmm.f90 +++ b/base/psblas/psb_sspmm.f90 @@ -83,7 +83,7 @@ subroutine psb_sspmv_vect(alpha,a,x,beta,y,desc_a,info,& character(len=20) :: name, ch_err logical :: aliw, doswap_ integer(psb_ipk_) :: debug_level, debug_unit - logical, parameter :: do_timings=.true. + logical, parameter :: do_timings=.false. integer(psb_ipk_), save :: mv_phase1=-1, mv_phase2=-1, mv_phase3=-1, mv_phase4=-1 integer(psb_ipk_), save :: mv_phase11=-1, mv_phase12=-1 @@ -197,7 +197,7 @@ subroutine psb_sspmv_vect(alpha,a,x,beta,y,desc_a,info,& if (allocated(a%ad)) then block - logical, parameter :: do_timings=.true. + logical, parameter :: do_timings=.false. real(psb_dpk_) :: t1, t2, t3, t4, t5 !if (me==0) write(0,*) 'going for overlap ',a%ad%get_fmt(),' ',a%and%get_fmt() if (do_timings) call psb_barrier(ctxt) @@ -218,7 +218,7 @@ subroutine psb_sspmv_vect(alpha,a,x,beta,y,desc_a,info,& else block - logical, parameter :: do_timings=.true. + logical, parameter :: do_timings=.false. real(psb_dpk_) :: t1, t2, t3, t4, t5 if (do_timings) call psb_barrier(ctxt) diff --git a/base/psblas/psb_zspmm.f90 b/base/psblas/psb_zspmm.f90 index 9309c417..23766b52 100644 --- a/base/psblas/psb_zspmm.f90 +++ b/base/psblas/psb_zspmm.f90 @@ -83,7 +83,7 @@ subroutine psb_zspmv_vect(alpha,a,x,beta,y,desc_a,info,& character(len=20) :: name, ch_err logical :: aliw, doswap_ integer(psb_ipk_) :: debug_level, debug_unit - logical, parameter :: do_timings=.true. + logical, parameter :: do_timings=.false. integer(psb_ipk_), save :: mv_phase1=-1, mv_phase2=-1, mv_phase3=-1, mv_phase4=-1 integer(psb_ipk_), save :: mv_phase11=-1, mv_phase12=-1 @@ -197,7 +197,7 @@ subroutine psb_zspmv_vect(alpha,a,x,beta,y,desc_a,info,& if (allocated(a%ad)) then block - logical, parameter :: do_timings=.true. + logical, parameter :: do_timings=.false. real(psb_dpk_) :: t1, t2, t3, t4, t5 !if (me==0) write(0,*) 'going for overlap ',a%ad%get_fmt(),' ',a%and%get_fmt() if (do_timings) call psb_barrier(ctxt) @@ -218,7 +218,7 @@ subroutine psb_zspmv_vect(alpha,a,x,beta,y,desc_a,info,& else block - logical, parameter :: do_timings=.true. + logical, parameter :: do_timings=.false. real(psb_dpk_) :: t1, t2, t3, t4, t5 if (do_timings) call psb_barrier(ctxt)